diff --git a/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/core/BufferedTensor.kt b/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/core/BufferedTensor.kt index 21030bbc7..4e286b489 100644 --- a/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/core/BufferedTensor.kt +++ b/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/core/BufferedTensor.kt @@ -77,5 +77,5 @@ internal val TensorStructure.tensor: IntTensor else -> this.toBufferedTensor().asTensor() } -public fun TensorStructure.toTypedTensor(): DoubleTensor = this.tensor -public fun TensorStructure.toTypedTensor(): IntTensor = this.tensor \ No newline at end of file +public fun TensorStructure.toDoubleTensor(): DoubleTensor = this.tensor +public fun TensorStructure.toIntTensor(): IntTensor = this.tensor \ No newline at end of file diff --git a/kmath-tensors/src/commonTest/kotlin/space/kscience/kmath/tensors/core/TestDoubleTensor.kt b/kmath-tensors/src/commonTest/kotlin/space/kscience/kmath/tensors/core/TestDoubleTensor.kt index eca54f68b..333a7bdec 100644 --- a/kmath-tensors/src/commonTest/kotlin/space/kscience/kmath/tensors/core/TestDoubleTensor.kt +++ b/kmath-tensors/src/commonTest/kotlin/space/kscience/kmath/tensors/core/TestDoubleTensor.kt @@ -67,8 +67,8 @@ internal class TestDoubleTensor { val bufferedTensorArray = ndArray.toBufferedTensor() // strides are flipped so data copied val tensorArray = bufferedTensorArray.asTensor() // data not contiguous so copied again - val tensorArrayPublic = ndArray.toTypedTensor() // public API, data copied twice - val sharedTensorArray = tensorArrayPublic.toTypedTensor() // no data copied by matching type + val tensorArrayPublic = ndArray.toDoubleTensor() // public API, data copied twice + val sharedTensorArray = tensorArrayPublic.toDoubleTensor() // no data copied by matching type assertTrue(tensorArray.mutableBuffer.array() contentEquals sharedTensorArray.mutableBuffer.array())