Skip to content

Reductions to single scalar, zero-dim tensors #105

@csarofeen

Description

@csarofeen

Today we don't support a reduction that results in a single scalar value, as the current infrastructure would see this as resulting in a zero-dimensional tensor.

We should first support zero-dimensional tensors, meaning be able to create them and pipe them through the code generator so it's implicitly recognized as a single scalar value and we can generate code for them.

This may include:

  • Modifying the TensorView class
  • Making sure arith.[c,h] can take 0-dim tensors as inputs and operate with scalar values (resulting in 0-dim tensor outputs)
  • Modifying the computeAt logic
    • Make sure zero-dim doesn't result in any asserts
    • Make sure we can still call computeAt(..., 0) on a 0 dim tensor
  • Checking tensor replay doesn't error if it gets a 0 dim tensor unless computeAt is somehow > 0
  • Checking index computations are correct for consumer/producer global/local
  • Checking we can re-broadcast the value with and without blockBroadcast
  • Creating tests

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions