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

Method default

torch/_export/serde/serialize.py:1647–1652  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

1645
1646class EnumEncoder(json.JSONEncoder):
1647 def default(self, obj):
1648 if isinstance(obj, Enum):
1649 return obj.value
1650 if isinstance(obj, bytes):
1651 return base64.b64encode(obj).decode('utf-8')
1652 return super().default(obj)
1653
1654
1655def serialize(

Callers 15

meta_copy_Function · 0.80
zeros_likeFunction · 0.80
transposeFunction · 0.80
unsafe_split_with_sizesFunction · 0.80
unsafe_chunk_py_implFunction · 0.80
upsample_nearest1d_vecFunction · 0.80
upsample_nearest2d_vecFunction · 0.80
upsample_nearest3d_vecFunction · 0.80

Calls 2

isinstanceFunction · 0.85
decodeMethod · 0.45

Tested by 15

test_cdist_forwardMethod · 0.64
fMethod · 0.64
fused_adamMethod · 0.64
fMethod · 0.64
test_load_tensorMethod · 0.64
test_decomposeMethod · 0.64
test_mmMethod · 0.64
test_mm_metaMethod · 0.64
test_mm_fakeMethod · 0.64