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

Function from_blob_list

caffe2/python/schema.py:1108–1123  ·  view source on GitHub ↗

Create a schema that clones the given schema, but containing the given list of values.

(schema, values, throw_on_type_mismatch=False)

Source from the content-addressed store, hash-verified

1106
1107
1108def from_blob_list(schema, values, throw_on_type_mismatch=False):
1109 """
1110 Create a schema that clones the given schema, but containing the given
1111 list of values.
1112 """
1113 assert isinstance(schema, Field), 'Argument `schema` must be a Field.'
1114 if isinstance(values, BlobReference):
1115 values = [values]
1116 record = schema.clone_schema()
1117 scalars = record.all_scalars()
1118 assert len(scalars) == len(values), (
1119 'Values must have %d elements, got %d.' % (len(scalars), len(values))
1120 )
1121 for scalar, value in zip(scalars, values):
1122 scalar.set_value(value, throw_on_type_mismatch, unsafe=True)
1123 return record
1124
1125
1126def as_record(value):

Callers 11

getMethod · 0.90
fetchMethod · 0.90
read_record_exMethod · 0.90
read_recordMethod · 0.90
contentMethod · 0.90
_datasetFunction · 0.90
test_dataset_opsMethod · 0.90
test_record_queueMethod · 0.90
processMethod · 0.90
FetchRecordFunction · 0.85
NewRecordFunction · 0.85

Calls 4

isinstanceFunction · 0.85
clone_schemaMethod · 0.80
all_scalarsMethod · 0.45
set_valueMethod · 0.45

Tested by 4

_datasetFunction · 0.72
test_dataset_opsMethod · 0.72
test_record_queueMethod · 0.72
processMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…