Skip to content

row major xtensor assignment is so slow #2749

Open
@argman

Description

@argman
using tensor_type_row = xt::xtensor<float, 4, xt::layout_type::row_major>;
using tensor_type_col = xt::xtensor<float, 4, xt::layout_type::column_major>;
auto tmp_a = tensor_type_col({200, 512, 512, 5});
tensor_type_col tmp_b;
tmp_b = xt::view(tmp_a, xt::all(), xt::all(), xt::all(), xt::range(1, 2));

this demo code cost about 400ms if i use row_major, 100ms of column major

how can i speed up this ?

its even slow than using for loop with openmp enabled.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions