parameters: (shape_a, shape_b, shape_bias, src_dtype, trans_a, trans_b)
docstring: Check the given input if legal
  
      Parameters:
      shape_a: list or tuple
              Shape of the first tensor a with rank > 1
      shape_b:  list or tuple
              Shape of the second tensor b with the same type with a,
              and shape_a, shape_b must be 2 dims
      shape_bias: list or tuple
              Shape of bias, only support the input data format with ND
      src_dtype: str
              The data type of input, support "float32", "float16"
      trans_a: bool
              If True, shape_a == transposed before multiplication
      trans_b: bool
             If True, shape_b == transposed before multiplication
  
      Returns None
docstring_summary: Check the given input if legal
docstring_tokens: Check the given input if legal
function: def _shape_check(shape_a, shape_b, shape_bias, src_dtype, trans_a, trans_b):
      """
      Check the given input if legal
  
      Parameters:
      shape_a: list or tuple
              Shape of the first tensor a with rank > 1
      shape_b:  list or tuple
              Shape of the second tensor b with the same type with a,
              and shape_a, shape_b must be 2 dims
      shape_bias: list or tuple
              Shape of bias, only support the input data format with ND
      src_dtype: str
              The data type of input, support "float32", "float16"
      trans_a: bool
              If True, shape_a == transposed before multiplication
      trans_b: bool
             If True, shape_b == transposed before multiplication
  
      Returns None
      """
      shape_len = len(shape_a)
      src_dtype = src_dtype.lower()
  
      check_list = ("float16",)
  
      if src_dtype not in check_list:
          raise RuntimeError("matmul_cce only support %s while src_dtype == %s"
                             % (",".join(check_list), src_dtype))
      if shape_len != len(shape_b):
          raise RuntimeError("length of a and b are not equal")
  
      if shape_len != 2:
          raise RuntimeError(
              "length of shape must be 2, more than 2 dimensions should use batch_matmul now!")
  
      m_shape, km_shape, n_shape, kn_shape = _get_km_kn_shape(shape_a, shape_b, trans_a, trans_b)
  
      if n_shape % cce.BLOCK_IN != 0 and n_shape != 1:
          raise RuntimeError("input shape N should be 1 or multiple of %d" % cce.BLOCK_IN)
      _check_mn_shape(m_shape, n_shape, km_shape, kn_shape)
      _check_bias(shape_bias, shape_a, shape_b, m_shape, n_shape)
function_tokens: def _shape_check ( shape_a , shape_b , shape_bias , src_dtype , trans_a , trans_b ) : shape_len = len ( shape_a ) src_dtype = src_dtype . lower ( ) check_list = ( "float16" , ) if src_dtype not in check_list : raise RuntimeError ( "matmul_cce only support %s while src_dtype == %s" % ( "," . join ( check_list ) , src_dtype ) ) if shape_len != len ( shape_b ) : raise RuntimeError ( "length of a and b are not equal" ) if shape_len != 2 : raise RuntimeError ( "length of shape must be 2, more than 2 dimensions should use batch_matmul now!" ) m_shape , km_shape , n_shape , kn_shape = _get_km_kn_shape ( shape_a , shape_b , trans_a , trans_b ) if n_shape % cce . BLOCK_IN != 0 and n_shape != 1 : raise RuntimeError ( "input shape N should be 1 or multiple of %d" % cce . BLOCK_IN ) _check_mn_shape ( m_shape , n_shape , km_shape , kn_shape ) _check_bias ( shape_bias , shape_a , shape_b , m_shape , n_shape )