Skip to content

Set data to a Tensor in Row/Column style #222

@AndreaCatania

Description

@AndreaCatania

I can create a 2x2 Matrix in this way:

let mut matrix = Tensor::new(&[2, 2]);

I would like to set its data in row / column style, something like:

// Using a macro to generate the Index
matrix[get_index(1, 1)] = 1.0;

// Using a function
matrix.set(1, 1, 1.0);

I'm not able to find any function / macro to perform this kind of operation, there is a reason for this?
(In case I'm available to submit a PR to implement it).

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