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

Function as_tensor

imperative/python/test/unit/core/test_indexing_op.py:26–30  ·  view source on GitHub ↗
(val, device)

Source from the content-addressed store, hash-verified

24
25def cvt_to_shape_desc(val, inpvar, config=None):
26 def as_tensor(val, device):
27 assert device is not None, "can not infer device"
28 # TODO: should copy to appropriate device
29 val = Tensor(val, device=device)
30 return val
31
32 device = None
33 if inpvar is not None:

Callers 2

cvt_to_shape_descFunction · 0.70
pushFunction · 0.70

Calls 3

TensorClass · 0.90
maxMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected