Tensor-Puzzles
Tensor-Puzzles copied to clipboard
Add error message for shape mismatch
Address for #14 , catch the shape mismatch before PyTorch throws RuntimeError.
Returns an error message as below:
AssertionError: Two tensors have a different shapes
Spec:
Expect: torch.Size([5])
Got: torch.Size([1, 5])
Sorry, this unfortunately breaks broadcasting. You could try catching the runtime error.
Sorry, I didn't notice this would break broadcasting. I've changed the assertion only for this particular runtime error.