@tf_export('math.unsorted_segment_sqrt_n', v1=['math.unsorted_segment_sqrt_n', 'unsorted_segment_sqrt_n'])
@deprecation.deprecated_endpoints('unsorted_segment_sqrt_n')
@dispatch.add_dispatch_support
def unsorted_segment_sqrt_n(data, segment_ids, num_segments, name=None):
    'Computes the sum along segments of a tensor divided by the sqrt(N).\n\n  Read [the section on\n  segmentation](https://tensorflow.org/api_guides/python/math_ops#segmentation)\n  for an explanation of segments.\n\n  This operator is similar to the unsorted segment sum operator found\n  [here](../../../api_docs/python/math_ops.md#UnsortedSegmentSum).\n  Additionally to computing the sum over segments, it divides the results by\n  sqrt(N).\n\n  \\\\(output_i = 1/sqrt(N_i) \\sum_{j...} data[j...]\\\\) where the sum is over\n  tuples `j...` such that `segment_ids[j...] == i` with \\\\N_i\\\\ being the\n  number of occurrences of id \\\\i\\\\.\n\n  If there is no entry for a given segment ID `i`, it outputs 0.\n\n  Note that this op only supports floating point and complex dtypes,\n  due to tf.sqrt only supporting these types.\n\n  If the given segment ID `i` is negative, the value is dropped and will not\n  be added to the sum of the segment.\n\n  Args:\n    data: A `Tensor` with floating point or complex dtype.\n    segment_ids: An integer tensor whose shape is a prefix of `data.shape`.\n    num_segments: An integer scalar `Tensor`.  The number of distinct\n      segment IDs.\n    name: A name for the operation (optional).\n\n  Returns:\n    A `Tensor`.  Has same shape as data, except for the first `segment_ids.rank`\n    dimensions, which are replaced with a single dimension which has size\n   `num_segments`.\n  '
    with ops.name_scope(name, 'UnsortedSegmentSqrtN'):
        data = ops.convert_to_tensor(data)
        segment_ids = ops.convert_to_tensor(segment_ids)
        N = _unsorted_segment_N(data, segment_ids, num_segments)
        summed = gen_math_ops.unsorted_segment_sum(data, segment_ids, num_segments)
        return (summed / gen_math_ops.sqrt(N))
Computes the sum along segments of a tensor divided by the sqrt(N).

Read [the section on
segmentation](https://tensorflow.org/api_guides/python/math_ops#segmentation)
for an explanation of segments.

This operator is similar to the unsorted segment sum operator found
[here](../../../api_docs/python/math_ops.md#UnsortedSegmentSum).
Additionally to computing the sum over segments, it divides the results by
sqrt(N).

\\(output_i = 1/sqrt(N_i) \sum_{j...} data[j...]\\) where the sum is over
tuples `j...` such that `segment_ids[j...] == i` with \\N_i\\ being the
number of occurrences of id \\i\\.

If there is no entry for a given segment ID `i`, it outputs 0.

Note that this op only supports floating point and complex dtypes,
due to tf.sqrt only supporting these types.

If the given segment ID `i` is negative, the value is dropped and will not
be added to the sum of the segment.

Args:
  data: A `Tensor` with floating point or complex dtype.
  segment_ids: An integer tensor whose shape is a prefix of `data.shape`.
  num_segments: An integer scalar `Tensor`.  The number of distinct
    segment IDs.
  name: A name for the operation (optional).

Returns:
  A `Tensor`.  Has same shape as data, except for the first `segment_ids.rank`
  dimensions, which are replaced with a single dimension which has size
 `num_segments`.
@tf_export('math.unsorted_segment_sqrt_n', v1=['math.unsorted_segment_sqrt_n', 'unsorted_segment_sqrt_n'])
@deprecation.deprecated_endpoints('unsorted_segment_sqrt_n')
@dispatch.add_dispatch_support
def unsorted_segment_sqrt_n(data, segment_ids, num_segments, name=None):
    'Computes the sum along segments of a tensor divided by the sqrt(N).\n\n  Read [the section on\n  segmentation](https://tensorflow.org/api_guides/python/math_ops#segmentation)\n  for an explanation of segments.\n\n  This operator is similar to the unsorted segment sum operator found\n  [here](../../../api_docs/python/math_ops.md#UnsortedSegmentSum).\n  Additionally to computing the sum over segments, it divides the results by\n  sqrt(N).\n\n  \\\\(output_i = 1/sqrt(N_i) \\sum_{j...} data[j...]\\\\) where the sum is over\n  tuples `j...` such that `segment_ids[j...] == i` with \\\\N_i\\\\ being the\n  number of occurrences of id \\\\i\\\\.\n\n  If there is no entry for a given segment ID `i`, it outputs 0.\n\n  Note that this op only supports floating point and complex dtypes,\n  due to tf.sqrt only supporting these types.\n\n  If the given segment ID `i` is negative, the value is dropped and will not\n  be added to the sum of the segment.\n\n  Args:\n    data: A `Tensor` with floating point or complex dtype.\n    segment_ids: An integer tensor whose shape is a prefix of `data.shape`.\n    num_segments: An integer scalar `Tensor`.  The number of distinct\n      segment IDs.\n    name: A name for the operation (optional).\n\n  Returns:\n    A `Tensor`.  Has same shape as data, except for the first `segment_ids.rank`\n    dimensions, which are replaced with a single dimension which has size\n   `num_segments`.\n  '
    with ops.name_scope(name, 'UnsortedSegmentSqrtN'):
        data = ops.convert_to_tensor(data)
        segment_ids = ops.convert_to_tensor(segment_ids)
        N = _unsorted_segment_N(data, segment_ids, num_segments)
        summed = gen_math_ops.unsorted_segment_sum(data, segment_ids, num_segments)
        return (summed / gen_math_ops.sqrt(N))