MCPcopy Index your code
hub / github.com/pytorch/pytorch / create_method

Function create_method

torch/_numpy/_ndarray.py:82–90  ·  view source on GitHub ↗
(fn, name=None)

Source from the content-addressed store, hash-verified

80
81
82def create_method(fn, name=None):
83 name = name or fn.__name__
84
85 def f(*args, **kwargs):
86 return fn(*args, **kwargs)
87
88 f.__name__ = name
89 f.__qualname__ = f"ndarray.{name}"
90 return f
91
92
93# Map ndarray.name_method -> np.name_func

Callers 1

ndarrayClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…