def _mode(self):
mode = (self.alpha - 1.) / self.beta
if self.allow_nan_stats:
nan = np.array(np.nan, dtype=self.dtype.as_numpy_dtype())
return math_ops.select(
self.alpha >= 1.,
mode,
array_ops.fill(self.batch_shape(), nan, name="nan"))
else:
return control_flow_ops.with_dependencies([
check_ops.assert_less(
array_ops.ones((), self.dtype),
self.alpha,
message="mode not defined for components of alpha <= 1"),
], mode)
评论列表
文章目录