ModularM
Modular2y ago
1 reply
pascalpolygon

Is there a simple way to implement Numpy-style ndarray slicing on Mojo Tensors ?

I have a rank 4 tensor where the first dimension is an index and the last 3 represent a Voxel Grid.

  # Initialize the observation space as a 4D tensor
        self.observation_space = Tensor[DType.int32](num_builds, build_volume[0], build_volume[1], build_volume[2])


I want to get the voxel grid given a build_id. I wrote a function to do this but I am wondering if I there's a Mojo way to do this.
Was this page helpful?