Hi, I am getting the following error. It’s hard for me to post my whole code because I’m working with a reinforcement learning library. I’m trying to use their A2C algorithm, they sample actions from a Gaussian distribution when given a state. Their code expects torch.float32
. I have checked and my inputs are indeed torch.float32
not Long. I’m not sure what to do. I know the algorithm runs as I have run it before, but I get this error when I try to use it in an environment with discrete actions.
Here is the library’s draw_action function:
def draw_action_t(self, state):
print('draw_action_t',state.dtype)
return self.distribution_t(state).sample().detach()
and
def distribution_t(self, state):
mu, sigma = self.get_mean_and_covariance(state)
return torch.distributions.MultivariateNormal(loc=mu, covariance_matrix=sigma)
Final error:
RuntimeError: _th_normal_ not supported on CPUType for Long
Help is much appreciated!