def METHOD_NAME(test_case, device, return_inverse, return_counts):
    dtype = random_util.choice([torch.int8, torch.int, torch.float, torch.double])
    input = random_tensor(ndim=3, dim0=random(), dim1=random(), dim2=random(), high=20)
    input = input.to(device).to(dtype)
    oneflow_output = flow.unique(
        input.oneflow,
        sorted=True,
        return_inverse=return_inverse,
        return_counts=return_counts,
    )
    torch_output = torch_ori.unique(
        input.pytorch,
        sorted=True,
        return_inverse=return_inverse,
        return_counts=return_counts,
    )
    if not return_inverse and not return_counts:
        oneflow_result = oneflow_output
        torch_result = torch_output
    else:
        oneflow_result = oneflow_output[0]
        torch_result = torch_output[0]
    test_case.assertTrue(
        np.allclose(oneflow_result.numpy(), torch_result.detach().cpu().numpy(),)
    )
    test_case.assertEqual(list(oneflow_result.shape), list(torch_result.shape))
    if return_inverse:
        oneflow_indices = oneflow_output[1]
        torch_indices = torch_output[1]
        test_case.assertTrue(
            np.allclose(oneflow_indices.numpy(), torch_indices.detach().cpu().numpy(),)
        )
        test_case.assertEqual(list(oneflow_indices.shape), list(torch_indices.shape))
    if return_counts:
        oneflow_counts = oneflow_output[-1]
        torch_counts = torch_output[-1]
        test_case.assertTrue(
            np.allclose(oneflow_counts.numpy(), torch_counts.detach().cpu().numpy(),)
        )
        test_case.assertEqual(list(oneflow_counts.shape), list(torch_counts.shape))