Class MPSNNImageNode

  • All Implemented Interfaces:
    NSObject

    public class MPSNNImageNode
    extends NSObject
    MPSNNImageNode A placeholder node denoting the position of a MPSImage in a graph MPS neural network graphs are made up of filter nodes connected by image (or state) nodes. An image node is produced by one filter but may be consumed by more than one filter. Most image nodes will be created by MPS and made available through MPSNNFilterNode.resultImage. Image nodes that are not created by MPS (i.e. "the graph inputs") must be created by you.
    • Constructor Detail

      • MPSNNImageNode

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

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

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

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

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

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

        public static java.lang.String description_static()
      • exportFromGraph

        public boolean exportFromGraph()
        Tag a image node for view later Most image nodes are private to the graph. These alias memory heavily and consequently generally have invalid state when the graph exits. When exportFromGraph = YES, the image is preserved and made available through the [MPSNNGraph encode... intermediateImages:... list. CAUTION: exporting an image from a graph prevents MPS from recycling memory. It will nearly always cause the amount of memory used by the graph to increase by the size of the image. There will probably be a performance regression accordingly. This feature should generally be used only when the node is needed as an input for further work and recomputing it is prohibitively costly. Default: NO
      • exportedNodeWithHandle

        public static java.lang.Object exportedNodeWithHandle​(NSObject handle)
        Create a autoreleased MPSNNImageNode with exportFromGraph = YES. Note: image is still temporary. See MPSNNImageNode.imageAllocator parameter.
      • format

        public long format()
        The preferred precision for the image Default: MPSImageFeatureChannelFormatNone, meaning MPS should pick a format Typically, this is 16-bit floating-point.
      • handle

        public MPSHandle handle()
        MPS resource identifier See MPSHandle protocol description. Default: nil
      • hash_static

        public static long hash_static()
      • imageAllocator

        public MPSImageAllocator imageAllocator()
        Configurability for image allocation Allows you to influence how the image is allocated Default: MPSTemporaryImage.defaultAllocator
      • instanceMethodSignatureForSelector

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

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

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

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

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

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

        public void setExportFromGraph​(boolean value)
        Tag a image node for view later Most image nodes are private to the graph. These alias memory heavily and consequently generally have invalid state when the graph exits. When exportFromGraph = YES, the image is preserved and made available through the [MPSNNGraph encode... intermediateImages:... list. CAUTION: exporting an image from a graph prevents MPS from recycling memory. It will nearly always cause the amount of memory used by the graph to increase by the size of the image. There will probably be a performance regression accordingly. This feature should generally be used only when the node is needed as an input for further work and recomputing it is prohibitively costly. Default: NO
      • setFormat

        public void setFormat​(long value)
        The preferred precision for the image Default: MPSImageFeatureChannelFormatNone, meaning MPS should pick a format Typically, this is 16-bit floating-point.
      • setHandle

        public void setHandle​(MPSHandle value)
        MPS resource identifier See MPSHandle protocol description. Default: nil
      • setImageAllocator

        public void setImageAllocator​(MPSImageAllocator value)
        Configurability for image allocation Allows you to influence how the image is allocated Default: MPSTemporaryImage.defaultAllocator
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

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

        public static long version_static()
      • setStopGradient

        public void setStopGradient​(boolean value)
        Stop training graph automatic creation at this node. An inference graph of MPSNNFilterNodes, MPSNNStateNodes and MPSNNImageNodes can be automatically converted to a training graph using -[MPSNNFilterNode trainingGraphWithSourceGradient:nodeHandler:]. Sometimes, an inference graph may contain extra nodes at start to do operations like resampling or range adjustment that should not be part of the training graph. To prevent gradient operations for these extra nodes from being included in the training graph, set .resultImage.stopGradient = YES. This will prevent gradient propagation beyond this MPSNNImageNode. Default: NO
      • setSynchronizeResource

        public void setSynchronizeResource​(boolean value)
        Set to true to cause the resource to be synchronized with the CPU It is not needed on iOS/tvOS devices, where it does nothing.
      • stopGradient

        public boolean stopGradient()
        Stop training graph automatic creation at this node. An inference graph of MPSNNFilterNodes, MPSNNStateNodes and MPSNNImageNodes can be automatically converted to a training graph using -[MPSNNFilterNode trainingGraphWithSourceGradient:nodeHandler:]. Sometimes, an inference graph may contain extra nodes at start to do operations like resampling or range adjustment that should not be part of the training graph. To prevent gradient operations for these extra nodes from being included in the training graph, set .resultImage.stopGradient = YES. This will prevent gradient propagation beyond this MPSNNImageNode. Default: NO
      • synchronizeResource

        public boolean synchronizeResource()
        Set to true to cause the resource to be synchronized with the CPU It is not needed on iOS/tvOS devices, where it does nothing.