class_docstr: This class tests all functions of the ArithmeticSharedTensor.
docstr: Tests division of encrypted tensor by scalar.
docstr_tok: ["Tests","division","of","encrypted","tensor","by","scalar","."]
code: def test_div(self) -> None:
      """Tests division of encrypted tensor by scalar."""
      for function in ["div", "div_"]:
          for scalar in [2, 2.0]:
              tensor = get_random_test_tensor(is_float=True)
  
              reference = tensor.float().div(scalar)
              encrypted_tensor = ArithmeticSharedTensor(tensor)
              encrypted_tensor = getattr(encrypted_tensor, function)(
                  scalar
              )
              self._check(
                  encrypted_tensor, reference, "division failed"
              )
  
              divisor = get_random_test_tensor(is_float=float)
              divisor += (divisor == 0).to(
                  dtype=divisor.dtype
              )  # div by 0
  
              reference = tensor.div(divisor)
              encrypted_tensor = ArithmeticSharedTensor(tensor)
              encrypted_tensor = getattr(encrypted_tensor, function)(
                  divisor
              )
              self._check(
                  encrypted_tensor, reference, "division failed"
              )
  
imports: import itertools
  import logging
  import unittest
  import crypten
  import crypten.communicator
  import torch
  import torch.nn.functional
  from crypten.common.rng import generate_random_ring_element
  from crypten.common.tensor_types import is_float_tensor
  from crypten.common.util import count_wraps
  from crypten.mpc.primitives import ArithmeticSharedTensor
  from test.multiprocess_test_case import get_random_test_tensor, MultiProcessTestCase
label_desc: Use image node_id 8 for calling the TestArithmetic obj's underlying member method code with example usage: obj.test_div() without return types