From febe526325150c2b716f233956a12e69fcb44804 Mon Sep 17 00:00:00 2001 From: Roland Grinis Date: Thu, 6 May 2021 14:50:05 +0100 Subject: [PATCH] Update stack docs --- .../kmath/tensors/core/algebras/DoubleTensorAlgebra.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/core/algebras/DoubleTensorAlgebra.kt b/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/core/algebras/DoubleTensorAlgebra.kt index 1c8eacf66..9500fbdec 100644 --- a/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/core/algebras/DoubleTensorAlgebra.kt +++ b/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/core/algebras/DoubleTensorAlgebra.kt @@ -493,14 +493,12 @@ public open class DoubleTensorAlgebra : TensorPartialDivisionAlgebra { DoubleTensor(tensor.shape, getRandomNormals(tensor.shape.reduce(Int::times), seed)) /** - * Concatenates a sequence of tensors along the first dimension. + * Concatenates a sequence of tensors with equal shapes along the first dimension. * * @param tensors the [List] of tensors with same shapes to concatenate - * @param dim the dimension to insert * @return tensor with concatenation result */ - public fun stack(tensors: List>, dim: Int = 0): DoubleTensor { - check(dim == 0) { "Stack by non-zero dimension not implemented yet" } + public fun stack(tensors: List>): DoubleTensor { check(tensors.isNotEmpty()) { "List must have at least 1 element" } val shape = tensors[0].shape check(tensors.all { it.shape contentEquals shape }) { "Tensors must have same shapes" }