def _variable(self, state): state = th.from_numpy(state).float() if len(state.size()) < 2: state = state.unsqueeze(0) return V(state)