class_docstr: This class tests all functions of BinarySharedTensor.
class_docstr_tok: ["This","class","tests","all","functions","of","BinarySharedTensor","."]
docstr: Tests share attribute getter and setter
docstr_tok: ["Tests","share","attribute","getter","and","setter"]
code: def test_share_attr(self) -> None:
      """Tests share attribute getter and setter"""
      for is_float in (True, False):
          reference = get_random_test_tensor(is_float=is_float)
          encrypted_tensor = BinarySharedTensor(reference)
          self.assertTrue(
              torch.equal(
                  encrypted_tensor.share, encrypted_tensor.share
              ),
              "share getter failed",
          )
  
          new_share = get_random_test_tensor(is_float=False)
          encrypted_tensor.share = new_share
          self.assertTrue(
              torch.equal(encrypted_tensor.share, new_share),
              "share setter failed",
          )
  
imports: import itertools
  import logging
  import unittest
  import crypten
  import torch
  from crypten.common.tensor_types import is_int_tensor
  from crypten.mpc.primitives import BinarySharedTensor
  from test.multiprocess_test_case import get_random_test_tensor, MultiProcessTestCase
label_desc: Use image node_id 15 for calling the TestBinary obj's underlying member method code with example usage: obj.test_share_attr() without return types