Skip to content

Accepting integer arguments for Array::range? #525

Open
@nyanpasu64

Description

@nyanpasu64

Right now I'm trying to pass integer arguments to Array::range. I have to first cast arguments to f32, then casting the result to int doesn't compile arr.mapv(|elem| elem as usize) does it work for Linspace<>?.

I noticed that range() works as I want for end<begin (unlike 5..1 which is empty). However #493 (comment) indicates I will have to perform data copies on every single range() I call, which sounds like a waste of resources.

Why doesn't Array::range and Linspace accept integer values?

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