Trace of the linear operator, equal to sum of `self.diag_part()`. If the operator is square, this is also the sum of the eigenvalues. Args: name: A name for this `Op`. Returns: Shape `[B1,...,Bb]` `Tensor` of same `dtype` as `self`.
(self, name="trace")
| 994 | return math_ops.reduce_sum(self.diag_part(), axis=-1) |
| 995 | |
| 996 | def trace(self, name="trace"): |
| 997 | """Trace of the linear operator, equal to sum of `self.diag_part()`. |
| 998 | |
| 999 | If the operator is square, this is also the sum of the eigenvalues. |
| 1000 | |
| 1001 | Args: |
| 1002 | name: A name for this `Op`. |
| 1003 | |
| 1004 | Returns: |
| 1005 | Shape `[B1,...,Bb]` `Tensor` of same `dtype` as `self`. |
| 1006 | """ |
| 1007 | with self._name_scope(name): |
| 1008 | return self._trace() |
| 1009 | |
| 1010 | def _add_to_tensor(self, x): |
| 1011 | # Override if a more efficient implementation is available. |