def get_mnk_from_matrix(shape_a_list, shape_b_list, trans_a, trans_b):
    """Get m, n and k value from input tensor shapes."""
    m, k = shape_a_list[-2], shape_a_list[-1]
    if trans_a:
        m, k = k, m

    n = shape_b_list[-2] if trans_b else shape_b_list[-1]
    return [m, n, k]