public class MLCGraph extends NSObject
A graph of layers that can be used to build a training or inference graph
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
MLCGraph(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
static MLCGraph |
alloc() |
static MLCGraph |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
boolean |
bindAndWriteDataForInputsToDeviceBatchSizeSynchronous(NSDictionary<java.lang.String,? extends MLCTensorData> inputsData,
NSDictionary<java.lang.String,? extends MLCTensor> inputTensors,
MLCDevice device,
long batchSize,
boolean synchronous)
Associates data with input tensors.
|
boolean |
bindAndWriteDataForInputsToDeviceSynchronous(NSDictionary<java.lang.String,? extends MLCTensorData> inputsData,
NSDictionary<java.lang.String,? extends MLCTensor> inputTensors,
MLCDevice device,
boolean synchronous)
Associates data with input tensors.
|
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
MLCTensor |
concatenateWithSourcesDimension(NSArray<? extends MLCTensor> sources,
long dimension)
Add a concat layer to the graph
|
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
MLCDevice |
device()
The device to be used when compiling and executing a graph
|
MLCTensor |
gatherWithDimensionSourceIndices(long dimension,
MLCTensor source,
MLCTensor indices)
Add a gather layer to the graph
|
static MLCGraph |
graph()
Creates a new graph.
|
static long |
hash_static() |
MLCGraph |
init() |
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
NSArray<? extends MLCLayer> |
layers()
Layers in the graph
|
static MLCGraph |
new_objc() |
MLCTensor |
nodeWithLayerSource(MLCLayer layer,
MLCTensor source)
Add a layer to the graph
|
MLCTensor |
nodeWithLayerSources(MLCLayer layer,
NSArray<? extends MLCTensor> sources)
Add a layer to the graph
|
MLCTensor |
nodeWithLayerSourcesDisableUpdate(MLCLayer layer,
NSArray<? extends MLCTensor> sources,
boolean disableUpdate)
Add a layer to the graph
|
MLCTensor |
nodeWithLayerSourcesLossLabels(MLCLayer layer,
NSArray<? extends MLCTensor> sources,
NSArray<? extends MLCTensor> lossLabels)
Add a loss layer to the graph
|
MLCTensor |
reshapeWithShapeSource(NSArray<? extends NSNumber> shape,
MLCTensor source)
Add a reshape layer to the graph
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
NSArray<? extends MLCTensor> |
resultTensorsForLayer(MLCLayer layer)
Get the result tensors for a layer in the training graph
|
MLCTensor |
scatterWithDimensionSourceIndicesCopyFromReductionType(long dimension,
MLCTensor source,
MLCTensor indices,
MLCTensor copyFrom,
int reductionType)
Add a scatter layer to the graph
|
MLCTensor |
selectWithSourcesCondition(NSArray<? extends MLCTensor> sources,
MLCTensor condition)
Add a select layer to the graph
|
static void |
setVersion_static(long aVersion) |
NSArray<? extends MLCTensor> |
sourceTensorsForLayer(MLCLayer layer)
Get the source tensors for a layer in the training graph
|
NSArray<? extends MLCTensor> |
splitWithSourceSplitCountDimension(MLCTensor source,
long splitCount,
long dimension)
Add a split layer to the graph
|
NSArray<? extends MLCTensor> |
splitWithSourceSplitSectionLengthsDimension(MLCTensor source,
NSArray<? extends NSNumber> splitSectionLengths,
long dimension)
Add a split layer to the graph
|
java.lang.String |
summarizedDOTDescription()
A DOT representation of the graph.
|
static org.moe.natj.objc.Class |
superclass_static() |
MLCTensor |
transposeWithDimensionsSource(NSArray<? extends NSNumber> dimensions,
MLCTensor source)
Add a transpose layer to the graph
|
static long |
version_static() |
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeypublic static boolean accessInstanceVariablesDirectly()
public static MLCGraph alloc()
public static MLCGraph allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public boolean bindAndWriteDataForInputsToDeviceBatchSizeSynchronous(NSDictionary<java.lang.String,? extends MLCTensorData> inputsData, NSDictionary<java.lang.String,? extends MLCTensor> inputTensors, MLCDevice device, long batchSize, boolean synchronous)
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.
inputsData - The input data to use to write to device memoryinputTensors - The list of tensors to perform writes ondevice - The devicebatchSize - 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.public boolean bindAndWriteDataForInputsToDeviceSynchronous(NSDictionary<java.lang.String,? extends MLCTensorData> inputsData, NSDictionary<java.lang.String,? extends MLCTensor> inputTensors, MLCDevice device, boolean synchronous)
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.
inputsData - The input data to use to write to device memoryinputTensors - The list of tensors to perform writes ondevice - The devicesynchronous - Whether to execute the copy to the device synchronously. For performance, asynchronous
execution is recommended.public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public MLCTensor concatenateWithSourcesDimension(NSArray<? extends MLCTensor> sources, long dimension)
sources - The source tensors to concatenatedimension - The concatenation dimensionpublic static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public MLCDevice device()
public MLCTensor gatherWithDimensionSourceIndices(long dimension, MLCTensor source, MLCTensor indices)
dimension - The dimension along which to indexsource - The source tensorindices - The index of elements to gatherpublic static MLCGraph graph()
public static long hash_static()
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static MLCGraph new_objc()
public MLCTensor nodeWithLayerSource(MLCLayer layer, MLCTensor source)
layer - The layersource - The source tensorpublic MLCTensor nodeWithLayerSources(MLCLayer layer, NSArray<? extends MLCTensor> sources)
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.
layer - The layersources - A list of source tensorspublic MLCTensor nodeWithLayerSourcesDisableUpdate(MLCLayer layer, NSArray<? extends MLCTensor> sources, boolean disableUpdate)
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.
layer - The layersources - A list of source tensorsdisableUpdate - A flag to indicate if optimizer update should be disabled for this layerpublic MLCTensor nodeWithLayerSourcesLossLabels(MLCLayer layer, NSArray<? extends MLCTensor> sources, NSArray<? extends MLCTensor> lossLabels)
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.
layer - The loss layerlossLabels - The loss labels tensorpublic MLCTensor reshapeWithShapeSource(NSArray<? extends NSNumber> shape, MLCTensor source)
shape - An array representing the shape of result tensorsource - The source tensorpublic static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public NSArray<? extends MLCTensor> resultTensorsForLayer(MLCLayer layer)
layer - A layer in the training graphpublic MLCTensor scatterWithDimensionSourceIndicesCopyFromReductionType(long dimension, MLCTensor source, MLCTensor indices, MLCTensor copyFrom, int reductionType)
dimension - The dimension along which to indexsource - The updates to use with scattering with index positions specified in indices to result tensorindices - The index of elements to scattercopyFrom - The source tensor whose data is to be first copied to the result tensorreductionType - 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.public MLCTensor selectWithSourcesCondition(NSArray<? extends MLCTensor> sources, MLCTensor condition)
sources - The source tensorscondition - The condition maskpublic static void setVersion_static(long aVersion)
public NSArray<? extends MLCTensor> sourceTensorsForLayer(MLCLayer layer)
layer - A layer in the training graphpublic NSArray<? extends MLCTensor> splitWithSourceSplitCountDimension(MLCTensor source, long splitCount, long dimension)
source - The source tensorsplitCount - The number of splitsdimension - The dimension to split the source tensorpublic NSArray<? extends MLCTensor> splitWithSourceSplitSectionLengthsDimension(MLCTensor source, NSArray<? extends NSNumber> splitSectionLengths, long dimension)
source - The source tensorsplitSectionLengths - The lengths of each split sectiondimension - The dimension to split the source tensorpublic java.lang.String summarizedDOTDescription()
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.
public static org.moe.natj.objc.Class superclass_static()
public MLCTensor transposeWithDimensionsSource(NSArray<? extends NSNumber> dimensions, MLCTensor source)
dimensions - NSArraypublic static long version_static()