code: def test_episodes_padding_tensors(eps_data):
      t = EpisodeBatch(**eps_data)
      N = len(t.lengths)
      max_ep_l = t.env_spec.max_episode_length
  
      observations = t.padded_observations
      actions = t.padded_actions
      rewards = t.padded_rewards
      valids = t.valids
      agent_infos = t.padded_agent_infos
  
      assert observations.shape == (
          N,
          max_ep_l,
          *t.observations[0].shape,
      )
      assert actions.shape == (N, max_ep_l, *t.actions[0].shape)
      assert rewards.shape == (N, max_ep_l)
      assert valids.shape == (N, max_ep_l)
      assert agent_infos.keys() == t.agent_infos.keys()
      for key in agent_infos.keys():
          assert agent_infos[key].shape == (
              N,
              max_ep_l,
              *t.agent_infos[key][0].shape,
          )
  
      start = 0
      for i, length in enumerate(t.lengths):
          stop = start + length
          assert (
              observations[i][:length] == t.observations[start:stop]
          ).all()
          assert np.count_nonzero(observations[i][length:]) == 0
          assert (actions[i][:length] == t.actions[start:stop]).all()
          assert np.count_nonzero(actions[i][length:]) == 0
          assert (rewards[i][:length] == t.rewards[start:stop]).all()
          assert np.count_nonzero(rewards[i][length:]) == 0
          assert (valids[i][:length] == np.ones((length,))).all()
          assert np.count_nonzero(valids[i][length:]) == 0
          for key in agent_infos.keys():
              assert (
                  agent_infos[key][i][:length]
                  == t.agent_infos[key][start:stop]
              ).all()
              assert np.count_nonzero(agent_infos[key][i][length:]) == 0
          start = stop
  
imports: import akro
  import gym.spaces
  import numpy
  import pytest
  from garage import EnvSpec, EnvStep, EpisodeBatch, StepType, TimeStep, TimeStepBatch
label_desc: Use image node_id 22 for calling a global function with example usage: test_episodes_padding_tensors(eps_data) without return types