def METHOD_NAME(
    test_case, in_device, out_device, in_device_list, out_device_list
):
    sbps = [
        flow.sbp.split(2),
        flow.sbp.split(3),
        flow.sbp.broadcast,
        flow.sbp.partial_sum,
    ]
    shape = (4, 4, 5, 7)
    in_placement = flow.placement(type=in_device, ranks=in_device_list)
    out_placement = flow.placement(type=out_device, ranks=out_device_list)
    rand_tensor = random_tensor(len(shape), *shape, requires_grad=False).oneflow
    for elem in itertools.product(sbps, sbps):
        x = rand_tensor.to_global(placement=in_placement, sbp=elem[0])
        y = x.to_global(placement=out_placement, sbp=elem[1])
        test_case.assertTrue(np.allclose(y.numpy(), x.numpy(), 1e-3, 1e-3))