code: def _block_matmul(m1, m2):
      """Multiplies block matrices represented as nested lists."""
      # Calls itself recursively to multiply blocks, until reaches the level of
      # tf.Tensors.
      if isinstance(m1, tf.Tensor):
          assert isinstance(m2, tf.Tensor)
          return tf.matmul(m1, m2)
      assert _is_nested_list(m1) and _is_nested_list(m2)
  
      i_max = len(m1)
      k_max = len(m2)
      j_max = 0 if k_max == 0 else len(m2[0])
      if i_max > 0:
          assert len(m1[0]) == k_max
  
      def row_by_column(i, j):
          return _block_add(
              *[_block_matmul(m1[i][k], m2[k][j]) for k in range(k_max)]
          )
  
      return [
          [row_by_column(i, j) for j in range(j_max)]
          for i in range(i_max)
      ]
  
file_path: tf-quant-finance/tf_quant_finance/math/custom_loops.py
imports: import tensorflow.compat.v2
  from tf_quant_finance import utils
label_desc: Use image node_id 7 for calling a global function with example usage: _block_matmul(m1, m2) and returns: unknown, tf, _block_add