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