def METHOD_NAME(
    test_case, shape, src_dtype, tgt_dtype, placement, sbp
):
    np_input = np.random.rand(*shape)
    input = random_tensor(ndim=len(shape)).oneflow.to_local()
    target = flow.tensor(np_input, dtype=tgt_dtype).to_global(placement, sbp)
    input = input.type_as(target)
    test_case.assertEqual(input.dtype, target.dtype)
    test_case.assertEqual(input.placement, target.placement)
    test_case.assertEqual(input.sbp, target.sbp)