Skip to content

Commit

Permalink
[tensor] reorder the sets toTensor to use len of produced seq
Browse files Browse the repository at this point in the history
  • Loading branch information
Vindaar committed Jun 16, 2024
1 parent 5b3c84c commit ad4cbc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/arraymancer/laser/tensor/initialization.nim
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ proc toTensor*[T](a: HashSet[T] | OrderedSet[T]): Tensor[T] =
## Result:
## - A Tensor of the same shape
var shape = MetaData()
shape.add(a.len)
let data = toSeq(a)
shape.add(data.len)
result = toTensor(data, shape)

proc toTensor*[T; U](a: HashSet[T] | OrderedSet[T], typ: typedesc[U]): Tensor[U] {.inline.} =
Expand Down

0 comments on commit ad4cbc2

Please sign in to comment.