Skip to content

Commit fbfee35

Browse files
committed
fix length check
1 parent 175fb5e commit fbfee35

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/tensors/tensor.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ TensorMap{T}(data::DenseVector{T}, codomain::TensorSpace, domain::TensorSpace) w
139139
Constrct a `TensorMap` from the given raw data.
140140
"""
141141
function _TensorMap{T, A}(data::DenseVector{T}, V::TensorMapSpace) where {T, A}
142-
length(data) == fusionblockstructure(space).totaldim ||
143-
throw(DimensionMismatch("invalid length of data"))
142+
length(data) == dim(V) || throw(DimensionMismatch("invalid length of data"))
144143
return TensorMap{T, spacetype(V), numout(V), numin(V), A}(data, V)
145144
end
146145
_TensorMap{T, A}(data::DenseVector{T}, codomain::TensorSpace, domain::TensorSpace) where {T, A} =

0 commit comments

Comments
 (0)