parameters: (op)
return_statement: return [tensor_shape.TensorShape([output_rows, output_cols])]
docstring: Shape function for a MatMul op.
docstring_summary: Shape function for a MatMul op.
docstring_tokens: Shape function for a MatMul op .
function: def matmul_shape(op):
    """Shape function for a MatMul op."""
    a_shape = op.inputs[0].get_shape().with_rank(2)
    transpose_a = op.get_attr("transpose_a")
    b_shape = op.inputs[1].get_shape().with_rank(2)
    transpose_b = op.get_attr("transpose_b")
    output_rows = a_shape[1] if transpose_a else a_shape[0]
    output_cols = b_shape[0] if transpose_b else b_shape[1]
    inner_a = a_shape[0] if transpose_a else a_shape[1]
    inner_b = b_shape[1] if transpose_b else b_shape[0]
    inner_a.assert_is_compatible_with(inner_b)
    return [tensor_shape.TensorShape([output_rows, output_cols])]
function_tokens: def matmul_shape ( op ) : a_shape = op . inputs [ 0 ] . get_shape ( ) . with_rank ( 2 ) transpose_a = op . get_attr ( "transpose_a" ) b_shape = op . inputs [ 1 ] . get_shape ( ) . with_rank ( 2 ) transpose_b = op . get_attr ( "transpose_b" ) output_rows = a_shape [ 1 ] if transpose_a else a_shape [ 0 ] output_cols = b_shape [ 0 ] if transpose_b else b_shape [ 1 ] inner_a = a_shape [ 0 ] if transpose_a else a_shape [ 1 ] inner_b = b_shape [ 1 ] if transpose_b else b_shape [ 0 ] inner_a . assert_is_compatible_with ( inner_b ) return [ tensor_shape . TensorShape ( [ output_rows , output_cols ] ) ]