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

Method net

caffe2/python/net_builder.py:210–225  ·  view source on GitHub ↗

Retrieves the current net, or add a new net to the builder. Args: net: If provided, add the given net to the active builder. Else, returns the current Net or creates a new one as needed. name: if provided, creates a new Net with given na

(self, net=None, name=None)

Source from the content-addressed store, hash-verified

208 Operations to be used in the context of a NetBuilder.
209 """
210 def net(self, net=None, name=None):
211 """
212 Retrieves the current net, or add a new net to the builder.
213 Args:
214 net: If provided, add the given net to the active builder.
215 Else, returns the current Net or creates a new one as needed.
216 name: if provided, creates a new Net with given name and makes
217 it the new current net of the active builder. Cannot
218 be provided if net is provided.
219 """
220 assert name is None or net is None, (
221 'Cannot provide both `net` and `name`.')
222 if net is not None:
223 NetBuilder.current().add(net)
224 return net
225 return NetBuilder.current().current_net(name=name)
226
227 def __getattr__(self, op_type):
228 """

Callers 15

__getattr__Method · 0.95
task_initMethod · 0.95
task_exitMethod · 0.95
task_instance_initMethod · 0.95
task_instance_exitMethod · 0.95
local_initMethod · 0.95
local_exitMethod · 0.95
task_reporterMethod · 0.95
forwardMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80

Calls 3

currentMethod · 0.80
current_netMethod · 0.80
addMethod · 0.45

Tested by 10

forwardMethod · 0.64
forwardMethod · 0.64
forwardMethod · 0.64
forwardMethod · 0.64
forwardMethod · 0.64
forwardMethod · 0.64
forwardMethod · 0.64
forwardMethod · 0.64
test_net_multi_useMethod · 0.64