MCPcopy Index your code
hub / github.com/pytorch/pytorch / FetchRecord

Function FetchRecord

caffe2/python/schema.py:1144–1160  ·  view source on GitHub ↗

Given a record containing BlobReferences, return a new record with same schema, containing numpy arrays, fetched from the current active workspace.

(blob_record, ws=None, throw_on_type_mismatch=False)

Source from the content-addressed store, hash-verified

1142
1143
1144def FetchRecord(blob_record, ws=None, throw_on_type_mismatch=False):
1145 """
1146 Given a record containing BlobReferences, return a new record with same
1147 schema, containing numpy arrays, fetched from the current active workspace.
1148 """
1149
1150 def fetch(v):
1151 if ws is None:
1152 return workspace.FetchBlob(str(v))
1153 else:
1154 return ws.blobs[str(v)].fetch()
1155
1156 assert isinstance(blob_record, Field)
1157 field_blobs = blob_record.field_blobs()
1158 assert all(isinstance(v, BlobReference) for v in field_blobs)
1159 field_arrays = [fetch(value) for value in field_blobs]
1160 return from_blob_list(blob_record, field_arrays, throw_on_type_mismatch)
1161
1162
1163def FeedRecord(blob_record, arrays, ws=None):

Callers 4

test_dequeue_manyMethod · 0.90
test_local_sessionMethod · 0.90
test_text_file_readerMethod · 0.90
test_dataset_opsMethod · 0.90

Calls 5

isinstanceFunction · 0.85
fetchFunction · 0.85
from_blob_listFunction · 0.85
allFunction · 0.50
field_blobsMethod · 0.45

Tested by 4

test_dequeue_manyMethod · 0.72
test_local_sessionMethod · 0.72
test_text_file_readerMethod · 0.72
test_dataset_opsMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…