MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / tensor_to_arg

Method tensor_to_arg

examples/diffusion/python_flux/models.py:126–130  ·  view source on GitHub ↗
(self, tensor)

Source from the content-addressed store, hash-verified

124 mgx.save(self.model, path, format="msgpack")
125
126 def tensor_to_arg(self, tensor):
127 mgx_shape = mgx.shape(type=self.torch_to_mgx_dtype_dict[tensor.dtype],
128 lens=list(tensor.size()),
129 strides=list(tensor.stride()))
130 return mgx.argument_from_pointer(mgx_shape, tensor.data_ptr())
131
132 def prealloc_buffers(self, param_names):
133 for param_name in param_names:

Callers 2

run_asyncMethod · 0.95
prealloc_buffersMethod · 0.95

Calls 2

shapeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected