else
{
// fill element of output kernel with zero element
- assert(folded_kernel.getDataType() == mir::DTYPE::FLOAT32 &&
+ assert(folded_kernel.getDataType() == mir::DataType::FLOAT32 &&
"unsupported data type, add appropriate zero element creation");
auto elem = reinterpret_cast<float *>(unfold_kernel.at(idx));
*elem = 0.0f;
mir::TensorVariant createTensor(const onnx::TensorProto *tensor)
{
- mir::DTYPE type;
+ mir::DataType type;
const void *src_data;
mir::Shape shape(tensor->dims_size());
for (int i = 0; i < tensor->dims_size(); ++i)
if (tensor->float_data_size() != 0)
{
assert(tensor->data_type() == onnx::TensorProto::FLOAT);
- type = mir::DTYPE::FLOAT32;
+ type = mir::DataType::FLOAT32;
src_data = tensor->float_data().data();
}
else if (tensor->double_data_size() != 0)
{
assert(tensor->data_type() == onnx::TensorProto::DOUBLE);
- type = mir::DTYPE::FLOAT64;
+ type = mir::DataType::FLOAT64;
src_data = tensor->double_data().data();
}
else if (tensor->int32_data_size() != 0)
{
assert(tensor->data_type() == onnx::TensorProto::INT32);
- type = mir::DTYPE::INT32;
+ type = mir::DataType::INT32;
src_data = tensor->int32_data().data();
}
else if (tensor->int64_data_size() != 0)
{
assert(tensor->data_type() == onnx::TensorProto::INT64);
- type = mir::DTYPE::INT64;
+ type = mir::DataType::INT64;
src_data = tensor->int64_data().data();
}
else if (tensor->has_raw_data())
switch (tensor->data_type())
{
case onnx::TensorProto::FLOAT:
- type = mir::DTYPE::FLOAT32;
+ type = mir::DataType::FLOAT32;
break;
case onnx::TensorProto::INT64:
- type = mir::DTYPE::INT64;
+ type = mir::DataType::INT64;
break;
default:
throw std::runtime_error("Unsupported data type");
{
data[i] = input_shape.dim(i);
}
- mir::TensorVariant tensor(mir::DTYPE::FLOAT32, output_shape, data.data());
+ mir::TensorVariant tensor(mir::DataType::FLOAT32, output_shape, data.data());
auto result = createOp<mir::ops::ConstantOp>(graph, tensor)->getOutput(0);
context->setNodeOutputs(onnx_node, {result});