Reduces input_tensor along the dimensions given in axis.
Unless keepdims is true, the rank of the tensor is reduced by 1 for each
of the entries in axis, which must be unique. If keepdims is true, the
reduced dimensions are retained with length 1.
If axis has no entries, all dimensions are reduced, and a
tensor with a single element is returned.
This function is more numerically stable than log(sum(exp(input))). It avoids
overflows caused by taking the exp of large inputs and underflows caused by
taking the log of small inputs.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.compat.v1.reduce_logsumexp\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/ops/math_ops.py#L3237-L3291) |\n\nComputes log(sum(exp(elements across dimensions of a tensor))). (deprecated arguments)\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.math.reduce_logsumexp`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/reduce_logsumexp)\n\n\u003cbr /\u003e\n\n tf.compat.v1.reduce_logsumexp(\n input_tensor,\n axis=None,\n keepdims=None,\n name=None,\n reduction_indices=None,\n keep_dims=None\n )\n\n### Used in the notebooks\n\n| Used in the tutorials |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| - [Fitting Dirichlet Process Mixture Model Using Preconditioned Stochastic Gradient Langevin Dynamics](https://www.tensorflow.org/probability/examples/Fitting_DPMM_Using_pSGLD) |\n\n| **Deprecated:** SOME ARGUMENTS ARE DEPRECATED: `(keep_dims)`. They will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead\n\nReduces `input_tensor` along the dimensions given in `axis`.\nUnless `keepdims` is true, the rank of the tensor is reduced by 1 for each\nof the entries in `axis`, which must be unique. If `keepdims` is true, the\nreduced dimensions are retained with length 1.\n\nIf `axis` has no entries, all dimensions are reduced, and a\ntensor with a single element is returned.\n\nThis function is more numerically stable than log(sum(exp(input))). It avoids\noverflows caused by taking the exp of large inputs and underflows caused by\ntaking the log of small inputs.\n\n#### For example:\n\n x = tf.constant([[0., 0., 0.], [0., 0., 0.]])\n tf.reduce_logsumexp(x) # log(6)\n tf.reduce_logsumexp(x, 0) # [log(2), log(2), log(2)]\n tf.reduce_logsumexp(x, 1) # [log(3), log(3)]\n tf.reduce_logsumexp(x, 1, keepdims=True) # [[log(3)], [log(3)]]\n tf.reduce_logsumexp(x, [0, 1]) # log(6)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------|\n| `input_tensor` | The tensor to reduce. Should have numeric type. |\n| `axis` | The dimensions to reduce. If `None` (the default), reduces all dimensions. Must be in the range `[-rank(input_tensor), rank(input_tensor))`. |\n| `keepdims` | If true, retains reduced dimensions with length 1. |\n| `name` | A name for the operation (optional). |\n| `reduction_indices` | The old (deprecated) name for axis. |\n| `keep_dims` | Deprecated alias for `keepdims`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| The reduced tensor. ||\n\n\u003cbr /\u003e"]]