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

Function almost_equal_schemas

caffe2/python/layers/layers.py:24–60  ·  view source on GitHub ↗
(
    record,
    original_schema,
    check_field_names=True,
    check_field_types=True,
    check_field_metas=False,
)

Source from the content-addressed store, hash-verified

22
23
24def almost_equal_schemas(
25 record,
26 original_schema,
27 check_field_names=True,
28 check_field_types=True,
29 check_field_metas=False,
30):
31 if original_schema == IdList:
32 return schema.equal_schemas(
33 record,
34 IdList,
35 check_field_names=check_field_names,
36 check_field_types=check_field_types,
37 check_field_metas=check_field_metas,
38 ) or schema.equal_schemas(
39 record,
40 IdListWithEvicted,
41 check_field_names=check_field_names,
42 check_field_types=check_field_types,
43 check_field_metas=check_field_metas,
44 )
45 elif original_schema == IdScoreList:
46 return schema.equal_schemas(
47 record,
48 IdScoreList,
49 check_field_names=check_field_names,
50 check_field_types=check_field_types,
51 check_field_metas=check_field_metas,
52 ) or schema.equal_schemas(
53 record,
54 IdScoreListWithEvicted,
55 check_field_names=check_field_names,
56 check_field_types=check_field_types,
57 check_field_metas=check_field_metas,
58 )
59 else:
60 return schema.equal_schemas(record, original_schema)
61
62
63def get_key(record):

Callers 5

_is_id_listMethod · 0.90
_is_id_score_listMethod · 0.90
_is_id_listFunction · 0.90
_is_id_score_listFunction · 0.90
get_keyFunction · 0.85

Calls

no outgoing calls

Tested by 2

_is_id_listMethod · 0.72
_is_id_score_listMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…