Skip to content

Broadcasting? #31

@shinzlet

Description

@shinzlet

We haven't implemented array broadcasting yet, and I don't think we have actually talked much about it. I'm not opposed to the idea, but in my years of using numpy, I don't believe I've ever fruitfully used it. Additionally, it is quite complicated to reason about as a user.

Is broadcasting actually important?

Pros:

  • Might increase performance. The current ways I'd reccommend for emulating broadcasting are:
    • using a tiling iterator (performant, but not vectorizable and relatively involved, probably takes >5 lines)
    • using #build to manually construct the result (not performant, but pretty easy, and clear to understand)
  • Terse

Cons:

  • Increases code complexity
  • Provides magic that a user might not expect
  • Can hide bugs by failing to issue a ShapeError
  • Terse

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions