Skip to content

Commit 361f22f

Browse files
committed
Fix all zeros
1 parent efb1454 commit 361f22f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

onnxruntime/test/framework/sparse_kernels_test.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,8 +756,7 @@ static NodeProto CreateConstantNodeAllZeros(bool indices_1D, std::vector<T>& exp
756756
constant_node.set_op_type("Constant");
757757
constant_node.add_output("dense_tensor_output");
758758

759-
std::vector<int64_t> indices;
760-
std::vector<int64_t> shape{2, 3, 2};
759+
const std::array<int64_t, 3> shape{2, 3, 2};
761760

762761
AttributeProto& attrib = *constant_node.mutable_attribute()->Add();
763762
attrib.set_name("sparse_value_all_zeros");
@@ -772,7 +771,7 @@ static NodeProto CreateConstantNodeAllZeros(bool indices_1D, std::vector<T>& exp
772771
} else {
773772
// indices are shape {NNZ, rank} so convert flattened values of 2, 5, 6 and 10 to rank 3 values
774773
indices_tp.add_dims(0);
775-
indices_tp.add_dims(0);
774+
indices_tp.add_dims(3);
776775
}
777776

778777
indices_tp.set_data_type(ONNX_NAMESPACE::TensorProto_DataType_INT64);

0 commit comments

Comments
 (0)