deephealthproject / eddl

European Distributed Deep Learning (EDDL) library. A general-purpose library initially developed to cover deep learning needs in healthcare use cases within the DeepHealth project.
https://deephealthproject.github.io/eddl/
MIT License
34 stars 10 forks source link

Add deletes on the testing side #210

Closed salvacarrion closed 3 years ago

salvacarrion commented 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;
}