MCPcopy Create free account
hub / github.com/pytorch/pytorch / get_key

Function get_key

caffe2/python/layers/layers.py:63–75  ·  view source on GitHub ↗
(record)

Source from the content-addressed store, hash-verified

61
62
63def get_key(record):
64 if almost_equal_schemas(record, IdList):
65 key = "values"
66 elif almost_equal_schemas(
67 record, IdScoreList, check_field_types=False
68 ):
69 key = "values:keys"
70 else:
71 raise NotImplementedError("Not implemented for {}".format(record))
72 assert record[key].metadata is not None, "Blob {} doesn't have metadata".format(
73 str(record[key]())
74 )
75 return record[key]
76
77
78def get_categorical_limit(record):

Callers 4

test_get_keyMethod · 0.90
__init__Method · 0.90
get_categorical_limitFunction · 0.70

Calls 2

almost_equal_schemasFunction · 0.85
formatMethod · 0.45

Tested by 2

test_get_keyMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…