def METHOD_NAME(self, B: int, W: int) -> None:
    num_features_per_rank = np.random.randint(low=1, high=20, size=(W,)).tolist()
    global_T = sum(num_features_per_rank)
    mixed_D_list = np.random.randint(low=1, high=10, size=(global_T,))
    grad_output = torch.randn(B, sum(mixed_D_list)).float().cuda()
    num_feature_offsets_list = torch.tensor(
        [0] + np.cumsum(num_features_per_rank).tolist()
    )
    dim_sum_per_rank = [
        sum(
            mixed_D_list[
                num_feature_offsets_list[i] : num_feature_offsets_list[i + 1]
            ]
        )
        for i in range(W)
    ]
    dim_sum_per_rank_tensor = torch.cuda.LongTensor(dim_sum_per_rank)
    cumsum_dim_sum_per_rank_tensor = torch.cuda.LongTensor(
        np.cumsum([0] + dim_sum_per_rank)[:-1]
    )
    grad_outputs_by_rank = grad_output.split(dim_sum_per_rank, dim=1)
    sharded_grad_output = torch.cat(
        [
            grad_output_by_rank.contiguous().view(-1)
            for grad_output_by_rank in grad_outputs_by_rank
        ],
        dim=0,
    )
    sharded_grad_output_impl = (
        torch.ops.fbgemm.recat_embedding_grad_output_mixed_D_batch(
            grad_output.cuda(),
            dim_sum_per_rank_tensor.cuda(),
            cumsum_dim_sum_per_rank_tensor.cuda(),
        )
    )
    torch.testing.assert_close(
        sharded_grad_output_impl.cpu(), sharded_grad_output.cpu()
    )
    num_features_per_rank = np.random.randint(low=1, high=20, size=(W,)).tolist()
    global_T = sum(num_features_per_rank)
    mixed_D_list = np.random.randint(low=1, high=10, size=(global_T,))
    grad_output = torch.randn(B, sum(mixed_D_list)).float().cuda()
    num_feature_offsets_list = torch.tensor(
        [0] + np.cumsum(num_features_per_rank).tolist()
    )
    dim_sum_per_rank = [
        sum(
            mixed_D_list[
                num_feature_offsets_list[i] : num_feature_offsets_list[i + 1]
            ]
        )
        for i in range(W)
    ]
    dim_sum_per_rank_tensor = torch.cuda.LongTensor(dim_sum_per_rank)
    cumsum_dim_sum_per_rank_tensor = torch.cuda.LongTensor(
        np.cumsum([0] + dim_sum_per_rank)[:-1]
    )
    grad_outputs_by_rank = grad_output.split(dim_sum_per_rank, dim=1)
    sharded_grad_output = torch.cat(
        [
            grad_output_by_rank.contiguous().view(-1)
            for grad_output_by_rank in grad_outputs_by_rank
        ],
        dim=0,
    )
    sharded_grad_output_impl = (
        torch.ops.fbgemm.recat_embedding_grad_output_mixed_D_batch(
            grad_output, dim_sum_per_rank_tensor, cumsum_dim_sum_per_rank_tensor
        )
    )
    torch.testing.assert_close(
        sharded_grad_output_impl.cpu(), sharded_grad_output.cpu()
    )