MCPcopy Index your code
hub / github.com/apache/tvm / _commit_internal

Method _commit_internal

python/tvm/contrib/tvmjs.py:180–194  ·  view source on GitHub ↗
(self, data, records)

Source from the content-addressed store, hash-verified

178 return self.shard_records
179
180 def _commit_internal(self, data, records):
181 data_path = f"{self.prefix}_{self.counter}.bin"
182 full_path = os.path.join(self.cache_dir, data_path)
183 self.counter += 1
184 with open(full_path, "wb") as outfile:
185 outfile.write(data)
186
187 shard_record = {
188 "dataPath": data_path,
189 "format": "raw-shard",
190 "nbytes": len(data),
191 "records": records,
192 "md5sum": _calculate_md5(full_path),
193 }
194 self.shard_records.append(shard_record)
195
196 @property
197 def pending_nbytes(self):

Callers 2

append_or_updateMethod · 0.95
commitMethod · 0.95

Calls 4

_calculate_md5Function · 0.85
writeMethod · 0.65
joinMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected