We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
RuntimeError Traceback (most recent call last) in 1 state = init_rnn_state(X.shape[0], num_hiddens, ctx) 2 inputs = to_onehot(X.to(ctx), len(vocab)) ----> 3 params = get_params() 4 outputs, state_new = rnn(inputs, state, params) 5 len(outputs), outputs[0].shape, state_new[0].shape
in get_params() 9 10 # Hidden layer parameters ---> 11 W_xh = _one((num_inputs, num_hiddens)) 12 W_hh = _one((num_hiddens, num_hiddens)) 13 b_h = torch.zeros(num_hiddens, device=ctx)
in _one(shape) 6 def get_params(): 7 def one(shape): ----> 8 return torch.Tensor(size=shape, device=ctx).normal(std=0.01) 9 10 # Hidden layer parameters
RuntimeError: legacy constructor for device type: cpu was passed device type: cuda, but device type must be: cpu
The text was updated successfully, but these errors were encountered:
No branches or pull requests
there is a runtime error when running the 7th code block. But I checked, the device type doesn't conflict each other. What's Wrong?
RuntimeError Traceback (most recent call last)
in
1 state = init_rnn_state(X.shape[0], num_hiddens, ctx)
2 inputs = to_onehot(X.to(ctx), len(vocab))
----> 3 params = get_params()
4 outputs, state_new = rnn(inputs, state, params)
5 len(outputs), outputs[0].shape, state_new[0].shape
in get_params()
9
10 # Hidden layer parameters
---> 11 W_xh = _one((num_inputs, num_hiddens))
12 W_hh = _one((num_hiddens, num_hiddens))
13 b_h = torch.zeros(num_hiddens, device=ctx)
in _one(shape)
6 def get_params():
7 def one(shape):
----> 8 return torch.Tensor(size=shape, device=ctx).normal(std=0.01)
9
10 # Hidden layer parameters
RuntimeError: legacy constructor for device type: cpu was passed device type: cuda, but device type must be: cpu
The text was updated successfully, but these errors were encountered: