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

Method AllocData

examples/quickstart/load/load_cpp.cc:50–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48ffi::Tensor Alloc1DTensor(std::initializer_list<float> data) {
49 struct CPUAllocator {
50 void AllocData(DLTensor* tensor) {
51 tensor->data = std::malloc(tensor->shape[0] * sizeof(float));
52 }
53 void FreeData(DLTensor* tensor) { std::free(tensor->data); }
54 };
55 DLDataType f32 = DLDataType({kDLFloat, 32, 1});

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected