class_docstr: Abstract implementation of encrypted tensor type. Every subclass of `CrypTensor`
  must implement the methods defined here. The actual tensor data should live in
  an instance attribute called `_tensor`. When implemented, the `CrypTensor`
  provides a full autograd implementation to the user.
class_docstr_tok: ["Abstract","implementation","of","encrypted","tensor","type",".","Every","subclass","of","`","CrypTensor","`","must","implement","the","methods","defined","here",".","The","actual","tensor","data","should","live","in","an","instance","attribute","called","`","_tensor","`",".","When","implemented",",","the","`","CrypTensor","`","provides","a","full","autograd","implementation","to","the","user","."]
docstr: Registers a custom :class:`CrypTensor` subclass.
  
  This decorator allows the user to instantiate a subclass of `CrypTensor`
  from Python cpde, even if the class itself is not  part of CrypTen. To use
  it, apply this decorator to a `CrypTensor` subclass, like this:
  
  .. code-block:: python
  
      @CrypTensor.register_cryptensor('my_cryptensor')
      class MyCrypTensor(CrypTensor):
          ...
docstr_tok: ["Registers","a","custom",":","class",":","`","CrypTensor","`","subclass",".","This","decorator","allows","the","user","to","instantiate","a","subclass","of","`","CrypTensor","`","from","Python","cpde",",","even","if","the","class","itself","is","not","part","of","CrypTen",".","To","use","it",",","apply","this","decorator","to","a","`","CrypTensor","`","subclass",",","like","this",":","..","code-block",":",":","python","@","CrypTensor.register_cryptensor","(","'my_cryptensor","'",")","class","MyCrypTensor","(","CrypTensor",")",":","..."]
code: def register_cryptensor(name):
      """Registers a custom :class:`CrypTensor` subclass.
  
      This decorator allows the user to instantiate a subclass of `CrypTensor`
      from Python cpde, even if the class itself is not  part of CrypTen. To use
      it, apply this decorator to a `CrypTensor` subclass, like this:
  
      .. code-block:: python
  
          @CrypTensor.register_cryptensor('my_cryptensor')
          class MyCrypTensor(CrypTensor):
              ...
      """
  
      def register_cryptensor_cls(cls):
          if name in CrypTensor.__CRYPTENSOR_TYPES__:
              raise ValueError(
                  "Cannot register duplicate CrypTensor type: \
                      tensor type {} already exists.".format(
                      name
                  )
              )
          if not issubclass(cls, CrypTensor):
              raise ValueError(
                  "Registered tensor ({}: {}) must extend \
                      CrypTensor".format(
                      name, cls.__name__
                  )
              )
          CrypTensor.__CRYPTENSOR_TYPES__[name] = cls
          return cls
  
      return register_cryptensor_cls
  
imports: from contextlib import contextmanager
  import torch
  from .debug import register_validation
  from .gradients import AutogradContext, BaseAutogradContext, get_grad_fn
  from .common import functions
label_desc: Use image node_id 1 for calling the CrypTensor obj's underlying member method code with example usage: obj.register_cryptensor(name) and returns: register_cryptensor_cls, cls