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

Method __getattr__

caffe2/python/core.py:2272–2282  ·  view source on GitHub ↗
(self, op_type)

Source from the content-addressed store, hash-verified

2270 return tuple(BlobReference(o, self) for o in op.output)
2271
2272 def __getattr__(self, op_type):
2273 if op_type.startswith('__'):
2274 raise AttributeError('Attribute {} not found.'.format(op_type))
2275 if not IsOperator(op_type) and not IsOperatorWithEngine(op_type, "CUDNN"):
2276 raise AttributeError(
2277 'Method ' + op_type + ' is not a registered operator.' +
2278 ' Did you mean: [' +
2279 ",".join(workspace.C.nearby_opnames(op_type)) + ']'
2280 )
2281 return lambda *args, **kwargs: self._CreateAndAddToSelf(
2282 op_type, *args, **kwargs)
2283
2284 def __dir__(self):
2285 TriggerLazyImport()

Callers 5

MergeConditionNetsFunction · 0.95
CombineConditionsFunction · 0.95
_CreateAndAddToNetMethod · 0.45
_runMethod · 0.45
_runMethod · 0.45

Calls 5

_CreateAndAddToSelfMethod · 0.95
IsOperatorFunction · 0.85
IsOperatorWithEngineFunction · 0.85
formatMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected