Commit bc70ef12 authored by Paul's avatar Paul
Browse files

Formatting

parent a4383620
...@@ -94,10 +94,12 @@ bool shape::broadcasted() const ...@@ -94,10 +94,12 @@ bool shape::broadcasted() const
std::size_t shape::element_space() const std::size_t shape::element_space() const
{ {
assert(this->lens().size() == this->strides().size()); assert(this->lens().size() == this->strides().size());
return std::inner_product( return std::inner_product(this->lens().begin(),
this->lens().begin(), this->lens().end(), this->strides().begin(), std::size_t{0}, std::plus<std::size_t>{}, [](std::size_t l, std::size_t s) { this->lens().end(),
return (l - 1) * s; this->strides().begin(),
}) + std::size_t{0},
std::plus<std::size_t>{},
[](std::size_t l, std::size_t s) { return (l - 1) * s; }) +
1; 1;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment