Class MLCGraph

  • All Implemented Interfaces:
    NSObject
    Direct Known Subclasses:
    MLCInferenceGraph, MLCTrainingGraph

    @Deprecated
    public class MLCGraph
    extends NSObject
    Deprecated.
    MLCGraph A graph of layers that can be used to build a training or inference graph API-Since: 14.0 Deprecated-Since: 100000.0 Deprecated-Message: Use Metal Performance Shaders Graph or BNNS instead.
    • Constructor Detail

      • MLCGraph

        protected MLCGraph​(org.moe.natj.general.Pointer peer)
        Deprecated.
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
        Deprecated.
      • alloc

        public static MLCGraph alloc()
        Deprecated.
      • allocWithZone

        public static MLCGraph allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
        Deprecated.
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
        Deprecated.
      • bindAndWriteDataForInputsToDeviceBatchSizeSynchronous

        public boolean bindAndWriteDataForInputsToDeviceBatchSizeSynchronous​(@NotNull
                                                                             @NotNull NSDictionary<java.lang.String,​? extends MLCTensorData> inputsData,
                                                                             @NotNull
                                                                             @NotNull NSDictionary<java.lang.String,​? extends MLCTensor> inputTensors,
                                                                             @NotNull
                                                                             @NotNull MLCDevice device,
                                                                             long batchSize,
                                                                             boolean synchronous)
        Deprecated.
        Associates data with input tensors. If the device is GPU, also copies the data to the device memory. Returns true if the data is successfully associated with input tensors. This function should be used if you execute the forward, gradient and optimizer updates independently. Before the forward pass is executed, the inputs should be written to device memory. Similarly, before the gradient pass is executed, the inputs (typically the initial gradient tensor) should be written to device memory. The caller must guarantee the lifetime of the underlying memory of each value of \p inputsData for the entirety of each corresponding input tensor's lifetime.
        Parameters:
        inputsData - The input data to use to write to device memory
        inputTensors - The list of tensors to perform writes on
        device - The device
        batchSize - The batch size. This should be set to the actual batch size that may be used when we execute the graph and can be a value less than or equal to the batch size specified in the tensor. If set to 0, we use batch size specified in the tensor.
        synchronous - Whether to execute the copy to the device synchronously. For performance, asynchronous execution is recommended.
        Returns:
        A Boolean value indicating whether the data is successfully associated with the tensor.
      • bindAndWriteDataForInputsToDeviceSynchronous

        public boolean bindAndWriteDataForInputsToDeviceSynchronous​(@NotNull
                                                                    @NotNull NSDictionary<java.lang.String,​? extends MLCTensorData> inputsData,
                                                                    @NotNull
                                                                    @NotNull NSDictionary<java.lang.String,​? extends MLCTensor> inputTensors,
                                                                    @NotNull
                                                                    @NotNull MLCDevice device,
                                                                    boolean synchronous)
        Deprecated.
        Associates data with input tensors. If the device is GPU, also copies the data to the device memory. Returns true if the data is successfully associated with input tensors. This function should be used if you execute the forward, gradient and optimizer updates independently. Before the forward pass is executed, the inputs should be written to device memory. Similarly, before the gradient pass is executed, the inputs (typically the initial gradient tensor) should be written to device memory. The caller must guarantee the lifetime of the underlying memory of each value of \p inputsData for the entirety of each corresponding input tensor's lifetime.
        Parameters:
        inputsData - The input data to use to write to device memory
        inputTensors - The list of tensors to perform writes on
        device - The device
        synchronous - Whether to execute the copy to the device synchronously. For performance, asynchronous execution is recommended.
        Returns:
        A Boolean value indicating whether the data is successfully associated with the tensor.
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
        Deprecated.
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
        Deprecated.
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
        Deprecated.
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
        Deprecated.
      • concatenateWithSourcesDimension

        @Nullable
        public @Nullable MLCTensor concatenateWithSourcesDimension​(@NotNull
                                                                   @NotNull NSArray<? extends MLCTensor> sources,
                                                                   long dimension)
        Deprecated.
        Add a concat layer to the graph
        Parameters:
        sources - The source tensors to concatenate
        dimension - The concatenation dimension
        Returns:
        A result tensor
      • debugDescription_static

        public static java.lang.String debugDescription_static()
        Deprecated.
      • description_static

        public static java.lang.String description_static()
        Deprecated.
      • device

        @Nullable
        public @Nullable MLCDevice device()
        Deprecated.
        The device to be used when compiling and executing a graph
      • gatherWithDimensionSourceIndices

        @Nullable
        public @Nullable MLCTensor gatherWithDimensionSourceIndices​(long dimension,
                                                                    @NotNull
                                                                    @NotNull MLCTensor source,
                                                                    @NotNull
                                                                    @NotNull MLCTensor indices)
        Deprecated.
        Add a gather layer to the graph
        Parameters:
        dimension - The dimension along which to index
        source - The source tensor
        indices - The index of elements to gather
        Returns:
        A result tensor API-Since: 14.5
      • graph

        public static MLCGraph graph()
        Deprecated.
        Creates a new graph.
        Returns:
        A new graph.
      • hash_static

        public static long hash_static()
        Deprecated.
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
        Deprecated.
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
        Deprecated.
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
        Deprecated.
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
        Deprecated.
      • layers

        @NotNull
        public @NotNull NSArray<? extends MLCLayer> layers()
        Deprecated.
        Layers in the graph
      • new_objc

        public static MLCGraph new_objc()
        Deprecated.
      • nodeWithLayerSource

        @Nullable
        public @Nullable MLCTensor nodeWithLayerSource​(@NotNull
                                                       @NotNull MLCLayer layer,
                                                       @NotNull
                                                       @NotNull MLCTensor source)
        Deprecated.
        Add a layer to the graph
        Parameters:
        layer - The layer
        source - The source tensor
        Returns:
        A result tensor
      • nodeWithLayerSources

        @Nullable
        public @Nullable MLCTensor nodeWithLayerSources​(@NotNull
                                                        @NotNull MLCLayer layer,
                                                        @NotNull
                                                        @NotNull NSArray<? extends MLCTensor> sources)
        Deprecated.
        Add a layer to the graph For variable length sequences of LSTMs/RNNs layers, create an MLCTensor of sortedSequenceLengths and pass it as the last index (i.e. index 2 or 4) of sources. This tensor must of be type MLCDataTypeInt32.
        Parameters:
        layer - The layer
        sources - A list of source tensors
        Returns:
        A result tensor
      • nodeWithLayerSourcesDisableUpdate

        @Nullable
        public @Nullable MLCTensor nodeWithLayerSourcesDisableUpdate​(@NotNull
                                                                     @NotNull MLCLayer layer,
                                                                     @NotNull
                                                                     @NotNull NSArray<? extends MLCTensor> sources,
                                                                     boolean disableUpdate)
        Deprecated.
        Add a layer to the graph For variable length sequences of LSTMs/RNNs layers, create an MLCTensor of sortedSequenceLengths and pass it as the last index (i.e. index 2 or 4) of sources. This tensor must of be type MLCDataTypeInt32.
        Parameters:
        layer - The layer
        sources - A list of source tensors
        disableUpdate - A flag to indicate if optimizer update should be disabled for this layer
        Returns:
        A result tensor
      • nodeWithLayerSourcesLossLabels

        @Nullable
        public @Nullable MLCTensor nodeWithLayerSourcesLossLabels​(@NotNull
                                                                  @NotNull MLCLayer layer,
                                                                  @NotNull
                                                                  @NotNull NSArray<? extends MLCTensor> sources,
                                                                  @NotNull
                                                                  @NotNull NSArray<? extends MLCTensor> lossLabels)
        Deprecated.
        Add a loss layer to the graph For variable length sequences of LSTMs/RNNs layers, create an MLCTensor of sortedSequenceLengths and pass it as the last index (i.e. index 2 or 4) of sources. This tensor must of be type MLCDataTypeInt32.
        Parameters:
        layer - The loss layer
        lossLabels - The loss labels tensor
        Returns:
        A result tensor
      • reshapeWithShapeSource

        @Nullable
        public @Nullable MLCTensor reshapeWithShapeSource​(@NotNull
                                                          @NotNull NSArray<? extends NSNumber> shape,
                                                          @NotNull
                                                          @NotNull MLCTensor source)
        Deprecated.
        Add a reshape layer to the graph
        Parameters:
        shape - An array representing the shape of result tensor
        source - The source tensor
        Returns:
        A result tensor
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
        Deprecated.
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
        Deprecated.
      • resultTensorsForLayer

        @NotNull
        public @NotNull NSArray<? extends MLCTensor> resultTensorsForLayer​(@NotNull
                                                                           @NotNull MLCLayer layer)
        Deprecated.
        Get the result tensors for a layer in the training graph
        Parameters:
        layer - A layer in the training graph
        Returns:
        A list of tensors
      • scatterWithDimensionSourceIndicesCopyFromReductionType

        @Nullable
        public @Nullable MLCTensor scatterWithDimensionSourceIndicesCopyFromReductionType​(long dimension,
                                                                                          @NotNull
                                                                                          @NotNull MLCTensor source,
                                                                                          @NotNull
                                                                                          @NotNull MLCTensor indices,
                                                                                          @NotNull
                                                                                          @NotNull MLCTensor copyFrom,
                                                                                          int reductionType)
        Deprecated.
        Add a scatter layer to the graph
        Parameters:
        dimension - The dimension along which to index
        source - The updates to use with scattering with index positions specified in indices to result tensor
        indices - The index of elements to scatter
        copyFrom - The source tensor whose data is to be first copied to the result tensor
        reductionType - The reduction type applied for all values in source tensor that are scattered to a specific location in the result tensor. Must be: MLCReductionTypeNone or MLCReductionTypeSum.
        Returns:
        A result tensor API-Since: 14.5
      • selectWithSourcesCondition

        @Nullable
        public @Nullable MLCTensor selectWithSourcesCondition​(@NotNull
                                                              @NotNull NSArray<? extends MLCTensor> sources,
                                                              @NotNull
                                                              @NotNull MLCTensor condition)
        Deprecated.
        Add a select layer to the graph
        Parameters:
        sources - The source tensors
        condition - The condition mask
        Returns:
        A result tensor API-Since: 14.5
      • setVersion_static

        public static void setVersion_static​(long aVersion)
        Deprecated.
      • sourceTensorsForLayer

        @NotNull
        public @NotNull NSArray<? extends MLCTensor> sourceTensorsForLayer​(@NotNull
                                                                           @NotNull MLCLayer layer)
        Deprecated.
        Get the source tensors for a layer in the training graph
        Parameters:
        layer - A layer in the training graph
        Returns:
        A list of tensors
      • splitWithSourceSplitCountDimension

        @Nullable
        public @Nullable NSArray<? extends MLCTensor> splitWithSourceSplitCountDimension​(@NotNull
                                                                                         @NotNull MLCTensor source,
                                                                                         long splitCount,
                                                                                         long dimension)
        Deprecated.
        Add a split layer to the graph
        Parameters:
        source - The source tensor
        splitCount - The number of splits
        dimension - The dimension to split the source tensor
        Returns:
        A result tensor
      • splitWithSourceSplitSectionLengthsDimension

        @Nullable
        public @Nullable NSArray<? extends MLCTensor> splitWithSourceSplitSectionLengthsDimension​(@NotNull
                                                                                                  @NotNull MLCTensor source,
                                                                                                  @NotNull
                                                                                                  @NotNull NSArray<? extends NSNumber> splitSectionLengths,
                                                                                                  long dimension)
        Deprecated.
        Add a split layer to the graph
        Parameters:
        source - The source tensor
        splitSectionLengths - The lengths of each split section
        dimension - The dimension to split the source tensor
        Returns:
        A result tensor
      • summarizedDOTDescription

        @NotNull
        public @NotNull java.lang.String summarizedDOTDescription()
        Deprecated.
        A DOT representation of the graph. For more info on the DOT language, refer to https://en.wikipedia.org/wiki/DOT_(graph_description_language). Edges that have a dashed lines are those that have stop gradients, while those with solid lines don't.
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
        Deprecated.
      • transposeWithDimensionsSource

        @Nullable
        public @Nullable MLCTensor transposeWithDimensionsSource​(@NotNull
                                                                 @NotNull NSArray<? extends NSNumber> dimensions,
                                                                 @NotNull
                                                                 @NotNull MLCTensor source)
        Deprecated.
        Add a transpose layer to the graph
        Parameters:
        dimensions - NSArray representing the desired ordering of dimensions The dimensions array specifies the input axis source for each output axis, such that the K'th element in the dimensions array specifies the input axis source for the K'th axis in the output. The batch dimension which is typically axis 0 cannot be transposed.
        Returns:
        A result tensor
      • version_static

        public static long version_static()
        Deprecated.
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.