def METHOD_NAME(self, assign_result, num_expected, **kwargs):
    """Randomly sample some negative samples."""
    neg_inds = paddle.nonzero(assign_result.gt_inds == 0, as_tuple=False)
    if float(neg_inds.numel()) != 0:
        neg_inds = neg_inds.squeeze() 
    if (float(neg_inds.numel())) <= float(num_expected):
        return neg_inds
    else:
        return self.random_choice(neg_inds, num_expected)