Skip to content
Snippets Groups Projects
Commit ead9cfd4 authored by Maxence Naud's avatar Maxence Naud
Browse files

[Fix] 'array type 'int [dim0*dim1*dim2]' is not assignable' in Test_Tensor.cpp

parent b3ca6d6c
No related branches found
No related tags found
No related merge requests found
...@@ -307,7 +307,7 @@ TEST_CASE("[core/data] Tensor(other)", "[Tensor][extract][zeros][print]") { ...@@ -307,7 +307,7 @@ TEST_CASE("[core/data] Tensor(other)", "[Tensor][extract][zeros][print]") {
const std::size_t dim1 = dimsDist(gen) + 1; const std::size_t dim1 = dimsDist(gen) + 1;
const std::size_t dim2 = dimsDist(gen) + 1; const std::size_t dim2 = dimsDist(gen) + 1;
std::vector<std::size_t> dims = {dim0, dim1, dim2}; std::vector<std::size_t> dims = {dim0, dim1, dim2};
int array0[dim0*dim1*dim2]; std::unique_ptr<int[]> array0(new int[dim0*dim1*dim2]);
for (std::size_t i = 0; i < dim0; ++i) { for (std::size_t i = 0; i < dim0; ++i) {
for (std::size_t j = 0; j < dim1; ++j) { for (std::size_t j = 0; j < dim1; ++j) {
for (std::size_t k = 0; k < dim2; ++k) { for (std::size_t k = 0; k < dim2; ++k) {
...@@ -323,7 +323,7 @@ TEST_CASE("[core/data] Tensor(other)", "[Tensor][extract][zeros][print]") { ...@@ -323,7 +323,7 @@ TEST_CASE("[core/data] Tensor(other)", "[Tensor][extract][zeros][print]") {
Tensor y1; Tensor y1;
Tensor y2; Tensor y2;
Tensor y3; Tensor y3;
x.getImpl()->setRawPtr(&array0, dim0*dim1*dim2); x.getImpl()->setRawPtr(array0.get(), dim0*dim1*dim2);
REQUIRE(x.isContiguous()); REQUIRE(x.isContiguous());
//////////////// ////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment