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

Method __getattr__

caffe2/python/net_builder.py:227–236  ·  view source on GitHub ↗

Adds an operator call to the currently active Net.

(self, op_type)

Source from the content-addressed store, hash-verified

225 return NetBuilder.current().current_net(name=name)
226
227 def __getattr__(self, op_type):
228 """
229 Adds an operator call to the currently active Net.
230 """
231 if op_type.startswith('__'):
232 raise AttributeError()
233 # We want hasattr to work properly even if no context is active.
234 if NetBuilder.current(required=False) is None:
235 raise AttributeError('No active NetBuilder.')
236 return getattr(self.net(), op_type)
237
238 def task_group(self):
239 """

Callers

nothing calls this directly

Calls 2

netMethod · 0.95
currentMethod · 0.80

Tested by

no test coverage detected