code: def test_repeated_matmul(size, n):
      M = torch.randn(size)
      result = repeated_matmul(M, n)
      assert result.shape == ((n,) + size)
  
      serial_result = M
      for i in range(n):
          assert_equal(result[i, ...], serial_result)
          serial_result = torch.matmul(serial_result, M)
  
imports: import math
  import numpy
  import pytest
  import scipy.fftpack
  import torch
  import pyro
  from pyro.ops.tensor_utils import block_diag_embed, block_diagonal, convolve, dct, idct, next_fast_len, periodic_cumsum, periodic_features, periodic_repeat, precision_to_scale_tril, repeated_matmul
  from tests.common import assert_close, assert_equal
label_desc: Use image node_id 8 for calling a global function with example usage: test_repeated_matmul(size, n) without return types