srush / Tensor-Puzzles

Solve puzzles. Improve your pytorch.
MIT License
2.96k stars 242 forks source link

Is `len` allowed? #3

Closed lkhphuc closed 2 years ago

lkhphuc commented 2 years ago

For example after puzzle 1, I want to construct a vectors of 1s with the same length as a given vector a, can I use ones(len(a))?

lkhphuc commented 2 years ago

Oy sorry. I missed that we can use shape.