docstr: Set up model.
docstr_tok: ["Set","up","model","."]
code: def __init__(self, opt, shared=None):
      """
      Set up model.
      """
      if torch.cuda.is_available():
          self.device = torch.device("cuda:0")
      else:
          self.device = torch.device("cpu")
      super().__init__(opt, shared)
      self.id = "Hred"
  
file_path: ParlAI/parlai/agents/hred/hred.py
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  import torch
  from parlai.agents.seq2seq.modules import opt_to_kwargs
  from parlai.core.torch_generator_agent import TorchGeneratorAgent
  from .modules import HredModel
label_desc: Use image node_id 2 to create a new HredAgent object from inherited base classes: TorchGeneratorAgent with example: obj = HredAgent(opt, shared)