def METHOD_NAME(seed, reduce_dim, row_a, col_b, transpose_a, transpose_b, batch_dims_a, batch_dims_b, ctx, func_name):
    from nbla_test_utils import backward_function_tester
    if transpose_a:
        shape_a = (reduce_dim, row_a)
    else:
        shape_a = (row_a, reduce_dim)
    if transpose_b:
        shape_b = (col_b, reduce_dim)
    else:
        shape_b = (reduce_dim, col_b)
    shape_a = batch_dims_a + shape_a
    shape_b = batch_dims_b + shape_b
    rng = np.random.RandomState(seed)
    # Input
    inputs = [
        rng.randn(*shape_a).astype(np.float32),
        rng.randn(*shape_b).astype(np.float32),
    ]
    backward_function_tester(rng, F.batch_matmul, inputs, func_args=[transpose_a, transpose_b],
                             atol_accum=1e-1, dstep=1e-3, ctx=ctx)