[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.contrib.losses.cosine_distance\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/losses/python/losses/loss_ops.py#L607-L652) |\n\nAdds a cosine-distance loss to the training procedure. (deprecated arguments) (deprecated) \n\n tf.contrib.losses.cosine_distance(\n predictions, labels=None, axis=None, weights=1.0, scope=None, dim=None\n )\n\n| **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed after 2016-12-30. Instructions for updating: Use tf.losses.cosine_distance instead.\n| **Warning:** SOME ARGUMENTS ARE DEPRECATED: `(dim)`. They will be removed in a future version. Instructions for updating: dim is deprecated, use axis instead\n\nNote that the function assumes that `predictions` and `labels` are already\nunit-normalized.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------------|---------------------------------------------------------------------------------------------------------------------|\n| `predictions` | An arbitrary matrix. |\n| `labels` | A `Tensor` whose shape matches 'predictions' |\n| `axis` | The dimension along which the cosine distance is computed. |\n| `weights` | Coefficients for the loss a scalar, a tensor of shape \\[batch_size\\] or a tensor whose shape matches `predictions`. |\n| `scope` | The scope for the operations performed in computing the loss. |\n| `dim` | The old (deprecated) name for `axis`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A scalar `Tensor` representing the loss value. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|------------------------------------------------------------------------------|\n| `ValueError` | If `predictions` shape doesn't match `labels` shape, or `weights` is `None`. |\n\n\u003cbr /\u003e"]]