Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
barne856 committed Jul 18, 2024
1 parent f99af5e commit c4457c1
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions include/squint/dynamic_tensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,6 @@ class dynamic_tensor : public iterable_tensor<dynamic_tensor<T, ErrorChecking>,
std::size_t total_size = std::accumulate(shape_.begin(), shape_.end(), 1ULL, std::multiplies<>());
data_.resize(total_size);
}
// Construct from initializer list
dynamic_tensor(std::vector<std::size_t> shape, std::initializer_list<T> init, layout layout = layout::column_major)
: shape_(std::move(shape)), layout_(layout) {
std::size_t total_size = std::accumulate(shape_.begin(), shape_.end(), 1ULL, std::multiplies<>());
if constexpr (ErrorChecking == error_checking::enabled) {
if (init.size() != total_size) {
throw std::invalid_argument("Initializer list size must match total size");
}
}
data_ = std::vector<T>(init);
}
// Construct from vector of elements
dynamic_tensor(std::vector<std::size_t> shape, const std::vector<T> &elements, layout layout = layout::column_major)
: shape_(std::move(shape)), layout_(layout) {
Expand Down

0 comments on commit c4457c1

Please sign in to comment.