unsorted_segment_min#

ivy.unsorted_segment_min(data, segment_ids, num_segments)[source]#

Compute the minimum along segments of an array. Segments are defined by an integer array of segment IDs.

Note

If the given segment ID i is negative, then the corresponding value is dropped, and will not be included in the result.

Parameters:
  • data (Union[Array, NativeArray]) – The array from which to gather values.

  • segment_ids (Union[Array, NativeArray]) – Must be in the same size with the first dimension of data. Has to be of integer data type. The index-th element of segment_ids array is the segment identifier for the index-th element of data.

  • num_segments (Union[int, Array, NativeArray]) – An integer or array representing the total number of distinct segment IDs.

Return type:

Array

Returns:

ret – The output array, representing the result of a segmented min operation. For each segment, it computes the min value in data where segment_ids equals to segment ID.

Array.unsorted_segment_min(self, segment_ids, num_segments)[source]#

ivy.Array instance method variant of ivy.unsorted_segment_min. This method simply wraps the function, and so the docstring for ivy.unsorted_segment_min also applies to this method with minimal changes.

Note

If the given segment ID i is negative, then the corresponding value is dropped, and will not be included in the result.

Parameters:
  • self (Array) – The array from which to gather values.

  • segment_ids (Array) – Must be in the same size with the first dimension of self. Has to be of integer data type. The index-th element of segment_ids array is the segment identifier for the index-th element of self.

  • num_segments (Union[int, Array]) – An integer or array representing the total number of distinct segment IDs.

Return type:

Array

Returns:

ret – The output array, representing the result of a segmented min operation. For each segment, it computes the min value in self where segment_ids equals to segment ID.

Container.unsorted_segment_min(self, segment_ids, num_segments)[source]#

ivy.Container instance method variant of ivy.unsorted_segment_min. This method simply wraps the function, and so the docstring for ivy.unsorted_segment_min also applies to this method with minimal changes.

Note

If the given segment ID i is negative, then the corresponding value is dropped, and will not be included in the result.

Parameters:
  • self (Container) – input array or container from which to gather the input.

  • segment_ids (Container) – Must be in the same size with the first dimension of self. Has to be of integer data type. The index-th element of segment_ids array is the segment identifier for the index-th element of self.

  • num_segments (Union[int, Container]) – An integer or array representing the total number of distinct segment IDs.

Returns:

ret – A container, representing the result of a segmented min operation. For each segment, it computes the min value in self where segment_ids equals to segment ID.