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

Method unwrap

test/test_proxy_tensor.py:129–134  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

127 @classmethod
128 def __torch_dispatch__(cls, func, types, args=(), kwargs=None):
129 def unwrap(e):
130 ret = e
131 if isinstance(e, UnwrapTensor):
132 ret = e._tensor.cos()
133
134 return ret
135
136 args = tree_map(unwrap, args)
137 kwargs = tree_map(unwrap, kwargs)

Callers

nothing calls this directly

Calls 2

isinstanceFunction · 0.85
cosMethod · 0.45

Tested by

no test coverage detected