parameters: (bias, input_x1, output_y, shape_a, shape_b, trans_a, trans_b)
return_statement: return shape_a_temp, format_a, shape_b_temp, format_b, shape_bias, src_dtype, dst_dtype
docstring: shape gen2
docstring_summary: shape gen2
docstring_tokens: shape gen2
function: def shape_gen2(bias, input_x1, output_y, shape_a, shape_b, trans_a, trans_b):
      """shape gen2"""
      shape_bias = ()
      if bias is not None and bool(bias):
          shape_bias = bias.get("shape")
          shape_bias = list(shape_bias)
          shape_bias = _get_bias(shape_bias)
  
      src_dtype = input_x1.get("dtype").lower()
      dst_dtype = output_y.get("dtype").lower()
      _shape_check(shape_a, shape_b, shape_bias, src_dtype, trans_a, trans_b)
  
      m_shape = shape_a[len(shape_a) - 2]
      km_shape = shape_a[len(shape_a) - 1]
      kn_shape = shape_b[len(shape_a) - 2]
      n_shape = shape_b[len(shape_a) - 1]
  
      if src_dtype == "float16":
          block_reduce = cce.BLOCK_REDUCE
  
      block_in = cce.BLOCK_IN
      block_out = cce.BLOCK_OUT
  
      if trans_a and km_shape == 1:
          block_in = cce.BLOCK_VECTOR
  
      if not trans_a and m_shape == 1:
          block_in = cce.BLOCK_VECTOR
  
      if trans_b and kn_shape == 1:
          block_out = cce.BLOCK_VECTOR
  
      if not trans_b and n_shape == 1:
          block_out = cce.BLOCK_VECTOR
  
      if trans_a:
          shape_a_temp = (m_shape // block_reduce, km_shape // block_in, block_reduce, block_in)
      else:
          shape_a_temp = (m_shape // block_in, km_shape // block_reduce, block_in, block_reduce)
  
      if trans_b:
          shape_b_temp = (kn_shape // block_out, n_shape // block_reduce, block_reduce, block_out)
      else:
          shape_b_temp = (kn_shape // block_reduce, n_shape // block_out, block_out, block_reduce)
      shape_a_temp = (shape_a_temp[0], shape_a_temp[1], shape_a_temp[2], shape_a_temp[3])
      format_a = "FRACTAL_NZ"
      shape_b_temp = (shape_b_temp[0], shape_b_temp[1], shape_b_temp[2], shape_b_temp[3])
      format_b = "FRACTAL_NZ"
      return shape_a_temp, format_a, shape_b_temp, format_b, shape_bias, src_dtype, dst_dtype
function_tokens: def shape_gen2 ( bias , input_x1 , output_y , shape_a , shape_b , trans_a , trans_b ) : shape_bias = ( ) if bias is not None and bool ( bias ) : shape_bias = bias . get ( "shape" ) shape_bias = list ( shape_bias ) shape_bias = _get_bias ( shape_bias ) src_dtype = input_x1 . get ( "dtype" ) . lower ( ) dst_dtype = output_y . get ( "dtype" ) . lower ( ) _shape_check ( shape_a , shape_b , shape_bias , src_dtype , trans_a , trans_b ) m_shape = shape_a [ len ( shape_a ) - 2 ] km_shape = shape_a [ len ( shape_a ) - 1 ] kn_shape = shape_b [ len ( shape_a ) - 2 ] n_shape = shape_b [ len ( shape_a ) - 1 ] if src_dtype == "float16" : block_reduce = cce . BLOCK_REDUCE block_in = cce . BLOCK_IN block_out = cce . BLOCK_OUT if trans_a and km_shape == 1 : block_in = cce . BLOCK_VECTOR if not trans_a and m_shape == 1 : block_in = cce . BLOCK_VECTOR if trans_b and kn_shape == 1 : block_out = cce . BLOCK_VECTOR if not trans_b and n_shape == 1 : block_out = cce . BLOCK_VECTOR if trans_a : shape_a_temp = ( m_shape // block_reduce , km_shape // block_in , block_reduce , block_in ) else : shape_a_temp = ( m_shape // block_in , km_shape // block_reduce , block_in , block_reduce ) if trans_b : shape_b_temp = ( kn_shape // block_out , n_shape // block_reduce , block_reduce , block_out ) else : shape_b_temp = ( kn_shape // block_reduce , n_shape // block_out , block_out , block_reduce ) shape_a_temp = ( shape_a_temp [ 0 ] , shape_a_temp [ 1 ] , shape_a_temp [ 2 ] , shape_a_temp [ 3 ] ) format_a = "FRACTAL_NZ" shape_b_temp = ( shape_b_temp [ 0 ] , shape_b_temp [ 1 ] , shape_b_temp [ 2 ] , shape_b_temp [ 3 ] ) format_b = "FRACTAL_NZ" return shape_a_temp , format_a , shape_b_temp , format_b , shape_bias , src_dtype , dst_dtype