Class SDIndex


  • public class SDIndex
    extends Object
    SDIndex is the SameDiff equivalent to INDArrayIndex it uses StridedSlice underneath to obtain varying elements. It also supports SDVariable inputs allowing for graph definitions of indexing operations.
    Author:
    Alex Black, Adam Gibson
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SDIndex.IndexType
      Index types include the following: 1.
    • Constructor Summary

      Constructors 
      Constructor Description
      SDIndex()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static SDIndex all()
      Represents all the elements in along this dimension.
      static SDIndex interval​(Integer begin, Integer end)
      Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
      static SDIndex interval​(Integer begin, Integer strides, Integer end)
      Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
      static SDIndex interval​(Long begin, Long end)
      Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
      static SDIndex interval​(Long begin, Long end, Boolean inclusive)
      Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
      static SDIndex interval​(Long begin, Long strides, Long end)
      Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
      static SDIndex interval​(Long begin, Long strides, Long end, Boolean inclusive)
      Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
      static SDIndex interval​(SDVariable begin, SDVariable end)
      Represents all elements begin to end (think get row from beginning to end) Note these are dynamic indices.
      static SDIndex interval​(SDVariable begin, SDVariable strides, SDVariable end)
      Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
      static SDIndex interval​(SDVariable begin, SDVariable strides, SDVariable end, SDVariable inclusive)
      Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
      static SDIndex point​(long i)
      Represents all elements at a singular point in this dimension (think row or column) This is a static index
      static SDIndex point​(long i, boolean keepDim)
      Represents all elements at a singular point in this dimension (think row or column) This is a static index
      static SDIndex point​(SDVariable i)
      Represents all elements at a singular point in this dimension (think row or column) Note this is the SDVariable version.
      static SDIndex point​(SDVariable i, boolean keepDim)
      Represents all elements at a singular point in this dimension (think row or column) This is a dynamic index
    • Constructor Detail

      • SDIndex

        public SDIndex()
    • Method Detail

      • all

        public static SDIndex all()
        Represents all the elements in along this dimension.
        Returns:
      • point

        public static SDIndex point​(SDVariable i)
        Represents all elements at a singular point in this dimension (think row or column) Note this is the SDVariable version. For static please use point(long)
        Parameters:
        i - the input index
        Returns:
      • point

        public static SDIndex point​(long i)
        Represents all elements at a singular point in this dimension (think row or column) This is a static index
        Parameters:
        i - the input index
        Returns:
      • point

        public static SDIndex point​(SDVariable i,
                                    boolean keepDim)
        Represents all elements at a singular point in this dimension (think row or column) This is a dynamic index
        Parameters:
        i - the input index
        Returns:
      • point

        public static SDIndex point​(long i,
                                    boolean keepDim)
        Represents all elements at a singular point in this dimension (think row or column) This is a static index
        Parameters:
        i - the input index
        Returns:
      • interval

        public static SDIndex interval​(SDVariable begin,
                                       SDVariable end)
        Represents all elements begin to end (think get row from beginning to end) Note these are dynamic indices.
        Parameters:
        begin - the begin index
        end - the end index
        Returns:
      • interval

        public static SDIndex interval​(Long begin,
                                       Long end)
        Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
        Parameters:
        begin - the begin index
        end - the end index
        Returns:
      • interval

        public static SDIndex interval​(Long begin,
                                       Long end,
                                       Boolean inclusive)
        Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
        Parameters:
        begin - the begin index
        end - the end index
        Returns:
      • interval

        public static SDIndex interval​(Integer begin,
                                       Integer end)
        Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
        Parameters:
        begin - the begin index
        end - the end index
        Returns:
      • interval

        public static SDIndex interval​(Long begin,
                                       Long strides,
                                       Long end)
        Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
        Parameters:
        begin - the begin index
        strides - the stride to increment by to end
        end - the end index
        Returns:
      • interval

        public static SDIndex interval​(Long begin,
                                       Long strides,
                                       Long end,
                                       Boolean inclusive)
        Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
        Parameters:
        begin - the begin index
        strides - the stride to increment by to end
        end - the end index
        inclusive - whether the index is inclusive or not
        Returns:
      • interval

        public static SDIndex interval​(Integer begin,
                                       Integer strides,
                                       Integer end)
        Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
        Parameters:
        begin - the begin index
        strides - the stride to increment by to end
        end - the end index
        Returns:
      • interval

        public static SDIndex interval​(SDVariable begin,
                                       SDVariable strides,
                                       SDVariable end)
        Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
        Parameters:
        begin - the begin index
        strides - the stride to increment by to end
        end - the end index
        Returns:
      • interval

        public static SDIndex interval​(SDVariable begin,
                                       SDVariable strides,
                                       SDVariable end,
                                       SDVariable inclusive)
        Represents all elements begin to end (think get row from beginning to end) Note these are static indices.
        Parameters:
        begin - the begin index
        strides - the stride to increment by to end
        end - the end index
        Returns: