class_docstr: Test class for Trainer.
class_docstr_tok: ["Test","class","for","Trainer","."]
docstr: Setup method which is called before every test.
docstr_tok: ["Setup","method","which","is","called","before","every","test","."]
code: def setup_method(self):
      """Setup method which is called before every test."""
      self.env = normalize(GymEnv("InvertedDoublePendulum-v2"))
      self.policy = GaussianMLPPolicy(
          env_spec=self.env.spec,
          hidden_sizes=(64, 64),
          hidden_nonlinearity=torch.tanh,
          output_nonlinearity=None,
      )
      self.value_function = GaussianMLPValueFunction(
          env_spec=self.env.spec
      )
      deterministic.set_seed(0)
      self.sampler = LocalSampler(
          agents=self.policy,
          envs=self.env,
          max_episode_length=self.env.spec.max_episode_length,
          is_tf_worker=True,
      )
  
file_path: garage/tests/garage/experiment/test_trainer.py
imports: import pytest
  import torch
  from garage.envs import GymEnv, normalize
  from garage.experiment import deterministic
  from garage.plotter import Plotter
  from garage.sampler import LocalSampler
  from garage.torch.algos import PPO
  from garage.torch.policies import GaussianMLPPolicy
  from garage.torch.value_functions import GaussianMLPValueFunction
  from garage.trainer import Trainer
  from tests.fixtures import snapshot_config
label_desc: Use image node_id 1 for calling the TestTrainer obj's underlying member method code with example usage: obj.setup_method() without return types