问题描述
这是抛出的错误
[..t_runtime_tensor.cpp:105 (create)] data.size_bytes() == size_bytes = false (bool)
terminate:cannot create input tensor
}terminate called without an active exception
不知道错哪里了,按照定义来的啊
复现步骤
dims_t in_shape{1,3,720,1280};
static float tr_data[1*3*720*1280];
这是使用的相关代码
dims_t in_shape{1,3,720,1280};
static float tr_data[137201280];
for(int n=0;n<137201280;n++)
{
tr_data[n] = ((uint8_t *)vaddr)[n] / 255.0f;
}
auto in_tensor = host_runtime_tensor::create(dt_float32, in_shape, { (gsl::byte *)tr_data, compute_size(in_shape)*sizoeof(float) },false,hrt::pool_shared).expect("cannot create input tensor");