def METHOD_NAME(inds, size):
    s_repeat_ = s_repeat.clone()
    inds = c_f.to_device(inds, tensor=s_repeat_floor)  # Added to avoid errors
    self.t = c_f.to_device(
        self.t, tensor=s_repeat_floor
    )  # Added to avoid errors
    indsa = (
        (s_repeat_floor - (self.t - self.step) > -self.eps)
        & (s_repeat_floor - (self.t - self.step) < self.eps)
        & inds
    )
    assert (
        indsa.nonzero().size()[0] == size
    ), "Another number of bins should be used"
    zeros = torch.zeros((1, indsa.size()[1])).to(
        device=indsa.device, dtype=torch.uint8
    )
    if self.cuda:
        zeros = zeros.cuda()
    indsb = torch.cat((indsa, zeros))[1:, :].to(
        dtype=torch.bool
    )  # Added to avoid bug with masks of uint8
    s_repeat_[~(indsb | indsa)] = 0
    # indsa corresponds to the first condition of the second equation of the paper
    self.t = self.t.to(
        dtype=s_repeat_.dtype
    )  # Added to avoid errors when using Half precision
    s_repeat_[indsa] = (s_repeat_ - self.t + self.step)[indsa] / self.step
    # indsb corresponds to the second condition of the second equation of the paper
    s_repeat_[indsb] = (-s_repeat_ + self.t + self.step)[indsb] / self.step
    return s_repeat_.sum(1) / size