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

Method replace

test/test_jit.py:4002–4010  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

4000 result = torch._C._jit_debug_module_iterators(sa._c)
4001
4002 def replace(e):
4003 if e is a.p:
4004 return 'P'
4005 elif e is a.foo.b:
4006 return 'B'
4007 elif isinstance(e, torch._C.ScriptModule):
4008 return e.getattr('name')
4009
4010 return e
4011 for v in result.values():
4012 for i in range(len(v)):
4013 if isinstance(v[i], tuple):

Callers 15

runMethod · 0.45
build_extensionsMethod · 0.45
handle_itemFunction · 0.45
__init__Method · 0.45
create_normalized_nameFunction · 0.45
test_mainMethod · 0.45
remove_whitespaceFunction · 0.45
_run_mypyFunction · 0.45

Calls 2

isinstanceFunction · 0.85
getattrMethod · 0.45

Tested by

no test coverage detected