Closed salvacarrion closed 3 years ago
I simply forgot to add "deletes" to the testing methods.
Solution: Add deletes.
Example:
TEST(TensorTestSuite, tensor_indexing_nonzero){ // Test #1 vector<int> t1_shape_ref = {4}; vector<float> d_t1_ref = {0, 1, 2, 4}; Tensor* t1_ref = new Tensor(t1_shape_ref, d_t1_ref.data(), DEV_CPU); vector<int> t1_shape = {5}; vector<float> d_t1 = {1, 1, 1, 0, 1}; Tensor* t1 = new Tensor(t1_shape, d_t1.data(), DEV_CPU); Tensor* new_t = t1->nonzero(true); ASSERT_TRUE(Tensor::equivalent(t1_ref, new_t, 10e-4)); // NEW DELETES ADDED ---------------------------------------------- delete t1_ref; delete t1; delete new_t; }
I simply forgot to add "deletes" to the testing methods.
Solution: Add deletes.
Example: