docstr: sample action by model or target_model
          
docstr_tok: ["sample","action","by","model","or","target_model"]
code: def sample(self, obs, use_target_model=False):
      """sample action by model or target_model"""
      obs = torch.FloatTensor(obs.reshape(1, -1)).to(self.device)
      act = self.alg.sample(obs, use_target_model=use_target_model)
      act_numpy = act.detach().cpu().numpy().flatten()
      return act_numpy
  
file_path: PARL/benchmark/torch/maddpg/simple_agent.py
imports: import parl
  import torch
  import numpy
  from parl.utils import ReplayMemory
label_desc: Use image node_id 3 for calling the MAAgent obj's underlying member method code with example usage: obj.sample(obs, use_target_model) and returns: act_numpy