You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to understand the ConstantOfShape operator and scalar 'tensors'. The example/backend test int32_shape_zero produces an output that should be a scalar of value 0 (if I understand it correctly).
In that directory, I read and print out the test result tensor using python:
import onnx
tensor=onnx.TensorProto()
with open('test_data_set_0/output_0.pb', 'rb') as f:
tensor.ParseFromString(f.read())
print(tensor)
The output is:
dims: 0
data_type: 6
name: "y"
raw_data: ""
I.e. the "tensor" is a scalar (dims: 0), and uses raw data storage. However, there is no data stored in raw_data (or in int32_data for that matter). Should there be?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to understand the ConstantOfShape operator and scalar 'tensors'. The example/backend test
int32_shape_zero
produces an output that should be a scalar of value 0 (if I understand it correctly).How do I find this value of the scalar output tensor from
output_0.pb
in the test data: https://github.com/onnx/onnx/tree/main/onnx/backend/test/data/node/test_constantofshape_int_shape_zero/test_data_set_0?In that directory, I read and print out the test result tensor using python:
The output is:
I.e. the "tensor" is a scalar (
dims: 0
), and uses raw data storage. However, there is no data stored in raw_data (or in int32_data for that matter). Should there be?Beta Was this translation helpful? Give feedback.
All reactions