class_docstr: Wrapper class for non linear function or module.
  
  Args:
      non_linear (callable or type): Non-linear function or type to be
          wrapped.
class_docstr_tok: ["Wrapper","class","for","non","linear","function","or","module",".","Args",":","non_linear","(","callable","or","type",")",":","Non-linear","function","or","type","to","be","wrapped","."]
code: def __init__(self, non_linear):
      super().__init__()
  
      if isinstance(non_linear, type):
          self.module = non_linear()
      elif callable(non_linear):
          self.module = copy.deepcopy(non_linear)
      else:
          raise ValueError(
              "Non linear function {} is not supported".format(
                  non_linear
              )
          )
  
imports: import copy
  import math
  import warnings
  import torch
  from torch import nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new NonLinearity object from inherited base classes: nn with example: obj = NonLinearity(non_linear)