docstr: Divides each element of :attr:`self` with the scalar :attr:`y` or
  each element of the tensor :attr:`y` and returns a new resulting tensor.
  
  For `y` a scalar:
  
  .. math::
      \text{out}_i = \frac{\text{self}_i}{\text{y}}
  
  For `y` a tensor:
  
  .. math::
      \text{out}_i = \frac{\text{self}_i}{\text{y}_i}
  
  Note for :attr:`y` a tensor, the shapes of :attr:`self` and :attr:`y` must be
  `broadcastable`_.
  
  .. _broadcastable:
      https://pytorch.org/docs/stable/notes/broadcasting.html#broadcasting-semantics
docstr_tok: ["Divides","each","element","of",":","attr",":","`","self","`","with","the","scalar",":","attr",":","`","y","`","or","each","element","of","the","tensor",":","attr",":","`","y","`","and","returns","a","new","resulting","tensor",".","For","`","y","`","a","scalar",":","..","math",":",":","\\text","{","out","}","_i","=","\\frac","{","\\text","{","self","}","_i","}","{","\\text","{","y","}","}","For","`","y","`","a","tensor",":","..","math",":",":","\\text","{","out","}","_i","=","\\frac","{","\\text","{","self","}","_i","}","{","\\text","{","y","}","_i","}","Note","for",":","attr",":","`","y","`","a","tensor",",","the","shapes","of",":","attr",":","`","self","`","and",":","attr",":","`","y","`","must","be","`","broadcastable","`","_",".","..","_broadcastable",":","https",":","\/\/pytorch.org\/docs\/stable\/notes\/broadcasting.html","#","broadcasting-semantics"]
code: def div(self, y):
      r"""Divides each element of :attr:`self` with the scalar :attr:`y` or
      each element of the tensor :attr:`y` and returns a new resulting tensor.
  
      For `y` a scalar:
  
      .. math::
          \text{out}_i = \frac{\text{self}_i}{\text{y}}
  
      For `y` a tensor:
  
      .. math::
          \text{out}_i = \frac{\text{self}_i}{\text{y}_i}
  
      Note for :attr:`y` a tensor, the shapes of :attr:`self` and :attr:`y` must be
      `broadcastable`_.
  
      .. _broadcastable:
          https://pytorch.org/docs/stable/notes/broadcasting.html#broadcasting-semantics
      """  # noqa: B950
      result = self.clone()
      if isinstance(y, CrypTensor):
          result.share = torch.broadcast_tensors(result.share, y.share)[
              0
          ].clone()
      elif is_tensor(y):
          result.share = torch.broadcast_tensors(result.share, y)[
              0
          ].clone()
  
      if isinstance(y, MPCTensor):
          return result.mul(y.reciprocal())
      result._tensor.div_(y)
      return result
  
imports: import torch
  from .None import communicator
  from .common.tensor_types import is_tensor
  from .common.util import torch_stack
  from .config import cfg
  from .cryptensor import CrypTensor
  from .cuda import CUDALongTensor
  from .encoder import FixedPointEncoder
  from .primitives.binary import BinarySharedTensor
  from .primitives.converters import convert
  from .ptype import ptype
label_desc: Use image node_id 26 for calling the MPCTensor obj's underlying member method code with example usage: obj.div(y) and returns: result, result