Skip to content

[C++ Frontend] Support multidimensional inputs to torch::tensor #16099

@goldsborough

Description

@goldsborough

🚀 Feature

torch::tensor(...) currently only supports flat tensors. In Python, torch.tensor supports arbitrarily nested inputs. It's not trivial to do this in C++ because the input to torch::tensor must be strongly typed, but we could figure something out or at least add overloads for up to 4 dimensions.

Motivation

Consistency with Python, which helps users.

CC @yf225

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions