Skip to content

We need a good way to log Tensor shapes in portable ops' error messages #7902

Closed
@swolchok

Description

@swolchok

🚀 The feature, motivation and pitch

Currently, when we complain about tensors' shapes, we don't include them in the log message because it's not obvious or convenient how to do this. I think we can write a shape_to_string function that uses an extremely finite amount of stack space (kTensorDimensionLimit * 4 digits per dim + commas, spaces, and parentheses) and use that to do this logging. (@dbort , how big an array can I put on the stack on a prototypical embedded system these days, and/or do you have any other ideas for how to do this?)

Alternatives

No response

Additional context

Motivating example: #7748 (comment)

RFC (Optional)

No response

cc @mergennachin @byjlw

Metadata

Metadata

Assignees

Labels

module: user experienceIssues related to reducing friction for userstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions