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

Function pyint2hval

imperative/python/src/tensor.cpp:348–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348bool pyint2hval(py::int_ obj, CompNode cn, DType dtype, HostTensorArgs& ret) {
349 if (!dtype.valid()) {
350 dtype = dtype::Int32();
351 }
352 ret.dtype = dtype;
353 ret.storage = scalar2storage((dt_int32)obj, cn, dtype);
354 return true;
355}
356
357bool pyfloat2hval(py::float_ obj, CompNode cn, DType dtype, HostTensorArgs& ret) {
358 if (!dtype.valid()) {

Callers 1

pyobj2hvalFunction · 0.85

Calls 2

scalar2storageFunction · 0.85
validMethod · 0.45

Tested by

no test coverage detected