public void ToShapedIndices(int[] shape, int flattenIndex, int[] ans) { var imShape = new IndexArray(shape); Assert.Equal(ans, NdArrayImpl.ToShapedIndices(imShape, flattenIndex)); }
public TransposeNdArrayImpl(NdArrayImpl <T> source, ReadOnlySpan <int> axisMap) : base(TransposeShape(source.Shape, axisMap)) { _source = source; _axisMap = axisMap.ToArray(); }
public void ToFlattenIndex(int[] shape, int[] shapedIndices, int ans) { var imShape = new IndexArray(shape); Assert.Equal(ans, NdArrayImpl <object> .ToFlattenIndex(imShape, shapedIndices)); }