for core_idx in range(kron_a.ndims()):
core = cores[core_idx]
core_det = tf.matrix_determinant(core[0, :, :, 0])
core_pow = pows / core.get_shape()[1].value
det *= tf.pow(core_det, core_pow)
return det
After Change
raise ValueError("The argument should be a Kronecker product of square "
"matrices (tt-cores must be square)")
pows = tf.cast(tf.reduce_prod(i_shapes), kron_a.dtype)
cores = kron_a.tt_cores
det = 1
for core_idx in range(kron_a.ndims()):
core = cores[core_idx]