tensors dimensions changed

This commit is contained in:
margarita0303 2022-07-12 20:37:00 +03:00
parent c7e224818b
commit 874da80446

View File

@ -886,9 +886,9 @@ public open class DoubleTensorAlgebra :
val size = tensor.dimension
val commonShape = tensor.shape.sliceArray(0 until size - 2)
val (n, m) = tensor.shape.sliceArray(size - 2 until size)
val uTensor = zeros(commonShape + intArrayOf(min(n, m), n))
val sTensor = zeros(commonShape + intArrayOf(min(n, m)))
val vTensor = zeros(commonShape + intArrayOf(min(n, m), m))
val uTensor = zeros(commonShape + intArrayOf(m, n))
val sTensor = zeros(commonShape + intArrayOf(m))
val vTensor = zeros(commonShape + intArrayOf(m, m))
val matrices = tensor.matrices
val uTensors = uTensor.matrices