Unverified Commit 2fa68ded authored by Charlie Lin's avatar Charlie Lin Committed by GitHub
Browse files

Update src/common.cpp


Co-authored-by: default avatarkahmed10 <15948690+kahmed10@users.noreply.github.com>
parent 6c63852d
...@@ -68,13 +68,9 @@ std::vector<std::size_t> compute_broadcasted_lens(std::vector<std::size_t> s0, ...@@ -68,13 +68,9 @@ std::vector<std::size_t> compute_broadcasted_lens(std::vector<std::size_t> s0,
std::vector<shape::dynamic_dimension> compute_broadcasted_dyn_dims(shape s0, shape s1) std::vector<shape::dynamic_dimension> compute_broadcasted_dyn_dims(shape s0, shape s1)
{ {
assert(s0.dynamic() or s1.dynamic());
// change both shapes to dynamic_dimension representation // change both shapes to dynamic_dimension representation
if(not s0.dynamic()) s0 = s0.to_dynamic();
s0 = s0.to_dynamic(); s1 = s1.to_dynamic();
if(not s1.dynamic())
s1 = s1.to_dynamic();
if(s0.ndim() > s1.ndim()) if(s0.ndim() > s1.ndim())
{ {
std::swap(s0, s1); std::swap(s0, s1);
......
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