MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / make_const

Method make_const

imperative/python/megengine/utils/network.py:270–274  ·  view source on GitHub ↗

r"""Makes an ImmutableTensor OpNode to provide a parameter for the network.

(self, data, name=None, device=None)

Source from the content-addressed store, hash-verified

268 return dump_info
269
270 def make_const(self, data, name=None, device=None):
271 r"""Makes an ImmutableTensor OpNode to provide a parameter for the network."""
272 node = ImmutableTensor(data, name, device, self.graph)
273 node.compile(self.graph)
274 return node.outputs[0]
275
276 def make_input_node(self, shape, dtype, name=None, device=None):
277 r"""Makes a Host2DeviceCopy OpNode to provide an input varnode for the network."""

Callers 3

visualizeFunction · 0.45
make_tensorFunction · 0.45
test_make_constFunction · 0.45

Calls 2

ImmutableTensorClass · 0.85
compileMethod · 0.45

Tested by 1

test_make_constFunction · 0.36