class_docstr: This class tests all functions of the ArithmeticSharedTensor.
docstr: Test matrix multiplication.
docstr_tok: ["Test","matrix","multiplication","."]
code: def test_matmul(self) -> None:
      """Test matrix multiplication."""
      for tensor_type in [lambda x: x, ArithmeticSharedTensor]:
          tensor = get_random_test_tensor(max_value=7, is_float=True)
          for width in range(2, tensor.nelement()):
              matrix_size = (tensor.nelement(), width)
              matrix = get_random_test_tensor(
                  max_value=7, size=matrix_size, is_float=True
              )
              reference = tensor.matmul(matrix)
              encrypted_tensor = ArithmeticSharedTensor(tensor)
              matrix = tensor_type(matrix)
              encrypted_tensor = encrypted_tensor.matmul(matrix)
              private_type = tensor_type == ArithmeticSharedTensor
              self._check(
                  encrypted_tensor,
                  reference,
                  "Private-%s matrix multiplication failed"
                  % ("private" if private_type else "public"),
              )
  
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 10 for calling the TestArithmetic obj's underlying member method code with example usage: obj.test_matmul() without return types