Skip to content

Zeros/Ones Tensor Constructor (Android) #15125

@GregoryComer

Description

@GregoryComer

🚀 The feature, motivation and pitch

It would be nice to have convenience constructors for Android tensors for all-ones and all-zeros tensors of a given shape. It isn't likely to have much production use, but is convenient for testing and sanity checks. Given the small code size increase, I think it would be worth adding.

Something like the following:

Tensor my_tensor = Tensor.ones(new long[] { 1, 3, 224, 224 });

Alternatives

No response

Additional context

No response

RFC (Optional)

No response

cc @kirklandsign @cbilgin

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersmodule: androidIssues related to Android code, build, and execution

    Projects

    Status

    No status

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions