tensor_lib::tensor is a class template that describes a mathematical tensor, implemented as a heap allocated array. It is build as an alternative to structures such as std::vector <std::vector <std::vector<...>>>, replicating its behaviour and syntax almost entirely with the added benefits of having its data contiguous in memory.
From your comment on #3 here are some suggestions,
Project layout
please provide a .clang-format file into the repo and use clang-format, it will help contribution
organize your files, make tests/src/include directories
use more tools, like sanitizers/clang-tidy...
you might want to use a testing library (e.g.: boost test, google test, ...)
watch out for your repo, there is a lot of duplicated commits, and strange merge from master, maybe get a better understanding of how Git works: https://git-scm.com/book/en/v2
you can use git revert for some or git reset/git commit --amend if it's not pushed
you should use a better name for 'helpers.hpp' as it is just IO (generally avoid generic names like helper, utils, controller...)
On the code itself:
you are using redundant == true and == false (clang-tidy is giving me this warning btw, you'd have to activate readability checks)
be consistent on the use of ! or not pick one (! is more common)
I am not a big fan of loops and ifs without blocks {} to avoid problems and be consistent
param_1 You might want to name those (and also TEST_1...)
generally avoid using raw new/delete it's not exception safe, etc, and in this case I think you could use std::swap_ranges, and why are you making copies?
also, you could factorize your duplicated code, like for instance, call the lvalue swap simply like swap(left, right) in the rvalue overload, it works because the rvalue has been named in the function:
if you haven't watched it already, here is a great talk on standard algorithms: https://www.youtube.com/watch?v=2olsGf6JIkU, generally CppCon is great and freely available on youtube :)
avoid using reinterpret_cast and read carefully the rules if you don't know them already (it's always good to reread them: https://en.cppreference.com/w/cpp/language/reinterpret_cast), moreover here you could just call _data.data() or to be more generic std::data(_data):
you should use std::equal with 4 iterators instead of 3 to do bound checking (I see that by design they have the same size, you should put comments at least then, there is also == it should work, maybe create a span with a templated size) minor issue
This would probably better be some kind of assert, this seems to be a logic error: