hi, @masahi still i am not able working still it throws memory error.
void FR_TVM_Deploy::forward(float* imgData) {
int in_size = (1 * 64 * 64 * 3 * 4); constexpr int dtype_code = kDLFloat; constexpr int dtype_bits = 32; constexpr int dtype_lanes = 1; constexpr int device_type = kDLCPU; constexpr int device_id = 0; constexpr int in_ndim = 4; const int64_t in_shape[in_ndim] = {1, 64, 64, 3}; //Allocating memeory to DLTensor object TVMArrayAlloc(in_shape, in_ndim, dtype_code, dtype_bits, dtype_lanes, device_type, device_id, &input);// TVMArrayCopyFromBytes(input, imgData, in_size); //Get globl function module for graph runtime tvm::runtime::Module* mod = (tvm::runtime::Module*)handle; // get the function from the module(set input data) tvm::runtime::PackedFunc set_input = mod->GetFunction("set_input"); set_input("input", input); // get the function from the module(run it) tvm::runtime::PackedFunc run = mod->GetFunction("run"); run(); int out_ndim = 2; int64_t out_shape[2] = {1, 256}; TVMArrayAlloc(out_shape, out_ndim, dtype_code, dtype_bits, dtype_lanes, device_type, device_id, &output); // get the function from the module(get output data) tvm::runtime::PackedFunc get_output = mod->GetFunction("get_output"); get_output(0, output); size_t out_size = out_shape[0] * out_shape[1]; std::vector<float> tvm_output(out_size, 0); TVMArrayCopyToBytes(output, &tvm_output[out_size], out_size); TVMArrayFree(input); TVMArrayFree(output); }
when i print the tvm_output vector i am getting all 0’s means output is coming 0, in llvm case i am getting correct output. here i am printing vector tvm_output in loop, is there any othere way to check output?