diff --git a/kmath-multik/src/main/kotlin/space/kscience/kmath/multik/MultikTensorAlgebra.kt b/kmath-multik/src/main/kotlin/space/kscience/kmath/multik/MultikTensorAlgebra.kt index a89e92c8e..04c467861 100644 --- a/kmath-multik/src/main/kotlin/space/kscience/kmath/multik/MultikTensorAlgebra.kt +++ b/kmath-multik/src/main/kotlin/space/kscience/kmath/multik/MultikTensorAlgebra.kt @@ -171,8 +171,7 @@ public class MultikTensorAlgebra internal constructor( val mt = asMultik().array return if (mt.shape.contentEquals(shape)) { - @Suppress("UNCHECKED_CAST") - this as NDArray + (this as MultikTensor).array } else { NDArray(mt.data, mt.offset, shape, dim = DN(shape.size), base = mt.base ?: mt) }.wrap()