Skip to content

Commit ec9d775

Browse files
Edited test cases for merge duplicates
1 parent 3d70c12 commit ec9d775

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_optimizers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -918,8 +918,8 @@ def test_duplicated_duplicated_constant(self):
918918
const_val = np.array([1, 2, 3], dtype=np.float32)
919919
tensor_1 = helper.make_tensor("tensor_1", TensorProto.FLOAT, const_val.shape, const_val)
920920
tensor_2 = helper.make_tensor("tensor_2", TensorProto.FLOAT, const_val.shape, const_val)
921-
tensor_3 = helper.make_tensor("tensor_3", TensorProto.FLOAT, const_val.shape, const_val.tobytes(), raw=True)
922-
tensor_4 = helper.make_tensor("tensor_4", TensorProto.FLOAT, const_val.shape, const_val.tobytes(), raw=True)
921+
tensor_3 = helper.make_tensor("tensor_3", TensorProto.FLOAT, const_val.shape, const_val)
922+
tensor_4 = helper.make_tensor("tensor_4", TensorProto.FLOAT, const_val.shape, const_val)
923923
node0 = helper.make_node('Constant', inputs=[], outputs=["value0"], value=tensor_1)
924924
node1 = helper.make_node('Constant', inputs=[], outputs=["value1"], value=tensor_2)
925925
node2 = helper.make_node('Constant', inputs=[], outputs=["value2"], value=tensor_3)
@@ -941,8 +941,8 @@ def test_duplicated_duplicated_constant(self):
941941

942942
def test_duplicated_duplicated_constant_and_initializer(self):
943943
const_val = np.array([1, 2, 3], dtype=np.float32)
944-
tensor_1 = helper.make_tensor("value0", TensorProto.FLOAT, const_val.shape, const_val)
945-
tensor_2 = helper.make_tensor("value1", TensorProto.FLOAT, const_val.shape, const_val)
944+
tensor_1 = helper.make_tensor("value0", TensorProto.FLOAT, const_val.shape, const_val.tobytes(), raw=True)
945+
tensor_2 = helper.make_tensor("value1", TensorProto.FLOAT, const_val.shape, const_val.tobytes(), raw=True)
946946
tensor_3 = helper.make_tensor("value2", TensorProto.FLOAT, const_val.shape, const_val.tobytes(), raw=True)
947947
tensor_4 = helper.make_tensor("value3", TensorProto.FLOAT, const_val.shape, const_val.tobytes(), raw=True)
948948
node0 = helper.make_node('Constant', inputs=[], outputs=["value0"], value=tensor_1)

0 commit comments

Comments
 (0)