torch tensor changes to numpy array in for/while loop?
print('\nCollecting experience')
for ep in range(400):
  state = env.reset()
  #print(state.shape)
  #state = np.array(state)
  state = state.transpose((2, 0, 1))
  #state = torch.from_numpy(state)
  state = Variable(torch.from_numpy(state))
  state = state.unsqueeze(0)
  print("AA", state.shape)
  episode_reward = 0
  step = 0

  for i in range(50):
    # env.render()
    print("BB",state.shape)
    action = agent.get_action(state)


i have tried and it works without the loop, it doesn't work with while loop either



what is printed:

Collecting experience
AA torch.Size([1, 1, 84, 84])
BB torch.Size([1, 1, 84, 84])
BB (84, 84, 1)


what is causing the second BB print?

solved it, turns out the problem was later in the loop, the next input wasn't the same, so made the processing into numpy and things into a function, and it worked
