def _matmul(self, x, adjoint=False, adjoint_arg=False): return _linalg.matmul(self._matrix, x, adjoint_a=adjoint, adjoint_b=adjoint_arg) def _solve(self, rhs, adjoint=False, adjoint_arg=False): return self._dense_solve(rhs, adjoint=adjoint, adjoint_arg=adjoint_arg) def _to_dense(self): return self._matrix @property def _composite_tensor_fields(self): return ("matrix", ) import numpy as np from tensorflow_probability.python.internal.backend.numpy import linalg_impl as _linalg from tensorflow_probability.python.internal.backend.numpy import ops as _ops from tensorflow_probability.python.internal.backend.numpy.gen import tensor_shape from tensorflow_probability.python.internal.backend.numpy import private distribution_util = private.LazyLoader( "distribution_util", globals(), "tensorflow_probability.substrates.numpy.internal.distribution_util") tensorshape_util = private.LazyLoader( "tensorshape_util", globals(), "tensorflow_probability.substrates.numpy.internal.tensorshape_util")
return _linalg.set_diag(mat, new_diag) def _eigvals(self): return self._ones_diag() * self.multiplier[..., _ops.newaxis] def _cond(self): # Condition number for a scalar time identity matrix is one, except when the # scalar is zero. return array_ops.where_v2(math_ops.equal(self._multiplier, 0.), _ops.cast(np.nan, dtype=self.dtype), _ops.cast(1., dtype=self.dtype)) @property def multiplier(self): """The [batch] scalar `Tensor`, `c` in `cI`.""" return self._multiplier import numpy as np from tensorflow_probability.python.internal.backend.numpy import linalg_impl as _linalg from tensorflow_probability.python.internal.backend.numpy import ops as _ops from tensorflow_probability.python.internal.backend.numpy.gen import tensor_shape from tensorflow_probability.python.internal.backend.numpy import private distribution_util = private.LazyLoader( "distribution_util", globals(), "tensorflow_probability.python.internal._numpy.distribution_util") tensorshape_util = private.LazyLoader( "tensorshape_util", globals(), "tensorflow_probability.python.internal._numpy.tensorshape_util")