MCPcopy Create free account
hub / github.com/apache/tvm-ffi / Tensor_FromDLPack

Function Tensor_FromDLPack

examples/abi_overview/example_code.c:177–187  ·  view source on GitHub ↗

[Tensor_FromDLPack.begin]

Source from the content-addressed store, hash-verified

175
176// [Tensor_FromDLPack.begin]
177TVMFFIObject* Tensor_FromDLPack(DLManagedTensorVersioned* from) {
178 int err_code = 0;
179 TVMFFIObject* out = NULL;
180 err_code = TVMFFITensorFromDLPackVersioned( //
181 from, // input DLPack tensor
182 /*require_alignment=*/0, // no alignment requirement
183 /*require_contiguous=*/1, // require contiguous tensor
184 (void**)(&out));
185 assert(err_code == 0);
186 return out;
187}
188// [Tensor_FromDLPack.end]
189
190// [Tensor_Alloc.begin]

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected