Skip to content
Advertisement

Test if an array is broadcastable to a shape?

What is the best way to test whether an array can be broadcast to a given shape?

The “pythonic” approach of trying doesn’t work for my case, because the intent is to have lazy evaluation of the operation.

I’m asking how to implement is_broadcastable below:

JavaScript

or better yet:

JavaScript

Advertisement

Answer

I really think you guys are over thinking this, why not just keep it simple?

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement