print(colored("Warning: weights are uniform and there is no unique mode.", "red", attrs=["bold"]))
if self._mode is None:
if self.sorted_by_weights:
self._mode = self.values[0]
else:
_, max_index = self.weights.max(-1)
self._mode = self.values[int(max_index)]
return self._mode
@property
After Change
// if self._uniform_weights:
// print(colored("Warning: weights are uniform and there is no unique mode.", "red", attrs=["bold"]))
if self._mode is None:
_, max_index = util.to_tensor(self._log_weights).max(-1)
self._mode = self._get_value(int(max_index))
return self._mode
@property
def effective_sample_size(self):