Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing too many matrices for complicated operands #32

Open
parrt opened this issue Sep 21, 2021 · 0 comments
Open

Showing too many matrices for complicated operands #32

parrt opened this issue Sep 21, 2021 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@parrt
Copy link
Owner

parrt commented Sep 21, 2021

The following code generates an exception but instead of showing the result of the operand subexpressions, it shows all bits of it:

toomany-1

import torch
import tsensor

n = 200         # number of instances
d = 764         # number of instance features
nhidden = 256

Whh = torch.eye(nhidden, nhidden)  # Identity matrix
Uxh = torch.randn(nhidden, d)
bh  = torch.zeros(nhidden, 1)
h = torch.randn(nhidden, 1)         # fake previous hidden state h
# r = torch.randn(nhidden, 1)         # fake this computation
r = torch.randn(nhidden, 3)         # fake this computation
X = torch.rand(n,d)                 # fake input

# Following code raises an exception
with tsensor.clarify():
    h = torch.tanh(Whh @ (r*h) + Uxh @ X.T + bh)  # state vector update equation
@parrt parrt added bug Something isn't working enhancement New feature or request labels Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant