class_docstr: Class to override ClassyModel method calls to ensure the wrapper is returned.
  
  This helps override calls like model.cuda() which return self, to return the
  wrapper instead of the underlying classy_model.
class_docstr_tok: ["Class","to","override","ClassyModel","method","calls","to","ensure","the","wrapper","is","returned",".","This","helps","override","calls","like","model.cuda","(",")","which","return","self",",","to","return","the","wrapper","instead","of","the","underlying","classy_model","."]
code: def __call__(self, *args, **kwargs):
      ret_val = self.classy_method(*args, **kwargs)
      if ret_val is self.wrapper.classy_model:
          # if the method is returning the classy_model, return the wrapper instead
          ret_val = self.wrapper
      return ret_val
  
imports: import copy
  import types
  from typing import Any, Dict, List, Optional, Tuple
  import torch
  import torch.nn
  from classy_vision.generic.util import log_class_usage
  from classy_vision.heads.classy_head import ClassyHead
  from .classy_block import ClassyBlock
label_desc: Use image node_id 2 for calling the _ClassyModelMethod obj's underlying member method code with example usage: obj.__call__() and returns: ret_val