This commit is contained in:
2025-11-17 20:47:42 +04:00
parent d7d93999a4
commit cdf955b34e
4 changed files with 110 additions and 5 deletions

View File

@@ -8,10 +8,7 @@
// ===== CONSTRUCTORS =====
template <typename T, int Dim>
Tensor<T, Dim>::Tensor(const std::array<size_t, Dim> &shape) : ITensor(shape) {
size_t size = 1;
for (size_t dim : shape)
size *= dim;
data_.resize(size);
data_.resize(getSize());
}
template <typename T, int Dim>
Tensor<T, Dim>::Tensor(const std::array<size_t, Dim> &shape, T value)