-
Notifications
You must be signed in to change notification settings - Fork 353
Open
Description
I'm trying to solve puzzles 4 and 5 by using the predefined where(q, a, b) function, which expects q to be a boolean tensor. To arrive at a boolean tensor, I create a boolean list and use tensor on it. I suppose this is not allowed? How else could I implement this?
This is my current implementation for puzzle 5 (identity matrix of dimension j)
def eye(j: int) -> TT["j", "j"]:
return where(tensor([[x==y for x in range(j)] for y in range(j)]), ones(j) - ones(j)[:, None] + ones(j), ones(j) - ones(j)[:, None])
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels