class_docstr: Base criterion class that mimics Pytorch's Loss.
class_docstr_tok: ["Base","criterion","class","that","mimics","Pytorch","'s","Loss","."]
code: def __getattribute__(self, name):
      if name != "forward":
          return object.__getattribute__(self, name)
  
      def forward_function(*args, **kwargs):
          """Silently encrypt Torch tensors if needed."""
          if self.encrypted or any(
              isinstance(arg, crypten.CrypTensor) for arg in args
          ):
              args = list(args)
              for idx, arg in enumerate(args):
                  if torch.is_tensor(arg):
                      args[idx] = crypten.cryptensor(arg)
          return object.__getattribute__(self, name)(
              *tuple(args), **kwargs
          )
  
      return forward_function
  
imports: import crypten
  import torch
  from .module import Module
label_desc: Use image node_id 4 for calling the _Loss obj's underlying member method code with example usage: obj.__getattribute__(name) and returns: forward_function, object, object