Closed seanshpark closed 3 weeks ago
when dump model.graph
, there is value_info
like
value_info {
name: "/Add_1_output_0"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 1
}
dim {
dim_value: 2
}
dim {
dim_value: 3
}
dim {
dim_value: 3
}
}
}
}
}
when dump
model.graph
, there isvalue_info
like
dim_value
selem_type
Is it correct..?
Is it correct..?
Yup :)
shape: [1,2,3,5]
(rank 4)
dtype is elem_type = 1
message TensorProto {
enum DataType {
UNDEFINED = 0;
// Basic types.
FLOAT = 1; // float
UINT8 = 2; // uint8_t
INT8 = 3; // int8_t
UINT16 = 4; // uint16_t
INT16 = 5; // int16_t
INT32 = 6; // int32_t
INT64 = 7; // int64_t
STRING = 8; // string
BOOL = 9; // bool
Type is defined like
message TypeProto {
message Tensor {
// This field MUST NOT have the value of UNDEFINED
// This field MUST have a valid TensorProto.DataType value
// This field MUST be present for this version of the IR.
optional int32 elem_type = 1;
optional TensorShapeProto shape = 2;
}
shape:
[1,2,3,5]
(rank 4) dtype iselem_type = 1
May I ask whether we should consider dynamic tensor shapes in this issue?
IMHO, dim_param
in tensor.dim
contains this information:
May I ask whether we should consider dynamic tensor shapes in this issue?
Maybe yes, but not now. This issue is to solve my internal problem with ONNX model.
done
onnx-dump.py
doesn't show tensor info (shape, dtype) let's revise this tool to show them.