import type { _NSArray } from "../Foundation/NSArray.js";
import type { _NSCopying } from "../Foundation/NSCopying.js";
import type { _NSData } from "../Foundation/NSData.js";
import type { _NSNumber } from "../Foundation/NSNumber.js";
import type { _NSObject } from "../Foundation/NSObject.js";
import type { _NSString } from "../Foundation/NSString.js";
import type { _MLCDevice } from "./MLCDevice.js";
import type { _MLCTensorData } from "./MLCTensorData.js";
import type { _MLCTensorDescriptor } from "./MLCTensorDescriptor.js";
import type { MLCDataType } from "./MLCDataType.js";
import type { MLCRandomInitializerType } from "./MLCRandomInitializerType.js";
export declare class _MLCTensor extends _NSObject {
    static alloc(): _MLCTensor;
    static new(): _MLCTensor;
    init(): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a tensor object without any data @return A new MLCTensor object
     */
    static tensorWithDescriptor$(tensorDescriptor: _MLCTensorDescriptor): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a tensor object initialized with a random initializer such as Glorot Uniform. @param tensorDescriptor The tensor descriptor @param randomInitializerType The random initializer type @return A new MLCTensor object
     */
    static tensorWithDescriptor$randomInitializerType$(tensorDescriptor: _MLCTensorDescriptor, randomInitializerType: MLCRandomInitializerType): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a tensor object with a MLCTensorData object that specifies the tensor data buffer @param tensorDescriptor The tensor descriptor @param fillData The scalar data to fill to tensor with @return A new MLCTensor object
     */
    static tensorWithDescriptor$fillWithData$(tensorDescriptor: _MLCTensorDescriptor, fillData: _NSNumber): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a tensor object with a MLCTensorData object that specifies the tensor data buffer @param tensorDescriptor The tensor descriptor @param data The random initializer type @return A new MLCTensor object
     */
    static tensorWithDescriptor$data$(tensorDescriptor: _MLCTensorDescriptor, data: _MLCTensorData): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a tensor object without any data. The tensor data type is MLCDataTypeFloat32. @param shape The tensor shape @return A new MLCTensor object
     */
    static tensorWithShape$(shape: _NSArray): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a tensor object initialized with a random initializer such as Glorot Uniform. The tensor data type is MLCDataTypeFloat32 @param shape The tensor shape @param randomInitializerType The random initializer type @return A new MLCTensor object
     */
    static tensorWithShape$randomInitializerType$(shape: _NSArray, randomInitializerType: MLCRandomInitializerType): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a tensor object initialized with a random initializer such as Glorot Uniform. The tensor data type is MLCDataTypeFloat32 @param shape The tensor shape @param randomInitializerType The random initializer type @param dataType The tensor data type @return A new MLCTensor object
     */
    static tensorWithShape$randomInitializerType$dataType$(shape: _NSArray, randomInitializerType: MLCRandomInitializerType, dataType: MLCDataType): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a tensor object without any data @param shape The tensor shape @param dataType The tensor data type @return A new MLCTensor object
     */
    static tensorWithShape$dataType$(shape: _NSArray, dataType: MLCDataType): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a tensor object with data @param shape The tensor shape @param data The tensor data @param dataType The tensor data type @return A new MLCTensor object
     */
    static tensorWithShape$data$dataType$(shape: _NSArray, data: _MLCTensorData, dataType: MLCDataType): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a tensor object with data @param shape The tensor shape @param fillData The scalar value to initialize the tensor data with @param dataType The tensor data type @return A new MLCTensor object
     */
    static tensorWithShape$fillWithData$dataType$(shape: _NSArray, fillData: _NSNumber, dataType: MLCDataType): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a NCHW tensor object with tensor data type = MLCDataTypeFloat32 @param width The tensor width @param height The tensor height @param featureChannelCount Number of feature channels @param batchSize The tensor batch size @return A new MLCTensor object
     */
    static tensorWithWidth$height$featureChannelCount$batchSize$(width: number, height: number, featureChannelCount: number, batchSize: number): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a NCHW tensor object initialized with a scalar value @param width The tensor width @param height The tensor height @param featureChannelCount Number of feature channels @param batchSize The tensor batch size @param fillData The scalar value to initialize the tensor data with @param dataType The tensor data type @return A new MLCTensorData object
     */
    static tensorWithWidth$height$featureChannelCount$batchSize$fillWithData$dataType$(width: number, height: number, featureChannelCount: number, batchSize: number, fillData: number, dataType: MLCDataType): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a NCHW tensor object initialized with a random initializer type. The tensor data type is MLCDataTypeFloat32 @param width The tensor width @param height The tensor height @param featureChannelCount Number of feature channels @param batchSize The tensor batch size @param randomInitializerType The random initializer type @return A new MLCTensor object
     */
    static tensorWithWidth$height$featureChannelCount$batchSize$randomInitializerType$(width: number, height: number, featureChannelCount: number, batchSize: number, randomInitializerType: MLCRandomInitializerType): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a NCHW tensor object with a tensor data object The tensor data type is MLCDataTypeFloat32. @param width The tensor width @param height The tensor height @param featureChannelCount Number of feature channels @param batchSize The tensor batch size @param data The tensor data @return A new MLCTensor object
     */
    static tensorWithWidth$height$featureChannelCount$batchSize$data$(width: number, height: number, featureChannelCount: number, batchSize: number, data: _MLCTensorData): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a NCHW tensor object with a tensor data object The tensor data type is MLCDataTypeFloat32. @param width The tensor width @param height The tensor height @param featureChannelCount Number of feature channels @param batchSize The tensor batch size @param data The tensor data @param dataType The tensor data type @return A new MLCTensor object
     */
    static tensorWithWidth$height$featureChannelCount$batchSize$data$dataType$(width: number, height: number, featureChannelCount: number, batchSize: number, data: _MLCTensorData, dataType: MLCDataType): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a tensor typically used by a recurrent layer The tensor data type is MLCDataTypeFloat32. @param sequenceLength The length of sequences stored in the tensor @param featureChannelCount Number of feature channels @param batchSize The tensor batch size @return A new MLCTensor object
     */
    static tensorWithSequenceLength$featureChannelCount$batchSize$(sequenceLength: number, featureChannelCount: number, batchSize: number): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a tensor typically used by a recurrent layer The tensor data type is MLCDataTypeFloat32. @param sequenceLength The length of sequences stored in the tensor @param featureChannelCount Number of feature channels @param batchSize The tensor batch size @param randomInitializerType The random initializer type @return A new MLCTensor object
     */
    static tensorWithSequenceLength$featureChannelCount$batchSize$randomInitializerType$(sequenceLength: number, featureChannelCount: number, batchSize: number, randomInitializerType: MLCRandomInitializerType): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a tensor typically used by a recurrent layer The tensor data type is MLCDataTypeFloat32. @param sequenceLength The length of sequences stored in the tensor @param featureChannelCount Number of feature channels @param batchSize The tensor batch size @param data The tensor data @return A new MLCTensor object
     */
    static tensorWithSequenceLength$featureChannelCount$batchSize$data$(sequenceLength: number, featureChannelCount: number, batchSize: number, data: _MLCTensorData | null): _MLCTensor;
    /**
     * @abstract Create a MLCTensor object @discussion Create a tensor of variable length sequences typically used by a recurrent layer The tensor data type is MLCDataTypeFloat32. @param sequenceLengths An array of sequence lengths @param sortedSequences A flag to indicate if the sequence lengths are sorted. If yes, they must be sorted in descending order @param featureChannelCount Number of feature channels @param batchSize The tensor batch size @param randomInitializerType The random initializer type @return A new MLCTensor object
     */
    static tensorWithSequenceLengths$sortedSequences$featureChannelCount$batchSize$randomInitializerType$(sequenceLengths: _NSArray, sortedSequences: boolean, featureChannelCount: number, batchSize: number, randomInitializerType: MLCRandomInitializerType): _MLCTensor | null;
    /**
     * @abstract Create a MLCTensor object @discussion Create a tensor of variable length sequences typically used by a recurrent layer The tensor data type is MLCDataTypeFloat32. @param sequenceLengths An array of sequence lengths @param sortedSequences A flag to indicate if the sequence lengths are sorted. If yes, they must be sorted in descending order @param featureChannelCount Number of feature channels @param batchSize The tensor batch size @param data The tensor data @return A new MLCTensor object
     */
    static tensorWithSequenceLengths$sortedSequences$featureChannelCount$batchSize$data$(sequenceLengths: _NSArray, sortedSequences: boolean, featureChannelCount: number, batchSize: number, data: _MLCTensorData | null): _MLCTensor | null;
    /**
     * @abstract Synchronize the data in host memory. @discussion Synchronize the data in host memory i.e. tensor.data with latest contents in device memory This should only be called once the graph that this tensor is used with has finished execution; Otherwise the results in device memory may not be up to date. NOTE: This method should not be called from a completion callback when device is the GPU. @return Returns YES if success, NO if there is a failure to synchronize
     */
    synchronizeData(): boolean;
    /**
     * @abstract Synchronize the optimizer data in host memory. @discussion Synchronize the optimizer data in host memory with latest contents in device memory This should only be called once the graph that this tensor is used with has finished execution; Otherwise the results in device memory may not be up to date. NOTE: This method should not be called from a completion callback when device is the GPU. @return Returns YES if success, NO if there is a failure to synchronize
     */
    synchronizeOptimizerData(): boolean;
    /**
     * @abstract Copy tensor data from device memory to user specified memory @discussion Before copying tensor data from device memory, one may need to synchronize the device memory for example when device is the GPU. The synchronizeWithDevice argumet can be set appropraitely to indicate this. For CPU this is ignored. If the tensor has been specified in outputs of a graph using addOutputs, synchronizeWithDevice should be set to NO. NOTE: This method should only be called once the graph that this tensor is used with has finished execution; Otherwise the results in device memory may not be up to date. synchronizeWithDevice must be set to NO when this method is called from a completion callback for GPU. @param bytes The user specified data in which to copy @param length The size in bytes to copy @param synchronizeWithDevice Whether to synchronize device memory if device is GPU @return Returns YES if success, NO if there is a failure to synchronize
     */
    copyDataFromDeviceMemoryToBytes$length$synchronizeWithDevice$(bytes: Uint8Array, length: number, synchronizeWithDevice: boolean): boolean;
    /**
     * @abstract Associates the given data to the tensor. If the device is GPU, also copies the data to the device memory. Returns true if the data is successfully associated with the tensor and copied to the device. @discussion The caller must guarantee the lifetime of the underlying memory of \p data for the entirety of the tensor's lifetime. For input tensors, we recommend that the bindAndwriteData method provided by MLCTrainingGraph and MLCInferenceGraph be used. This method should only be used to allocate and copy data to device memory for tensors that are typically layer parameters such as weights, bias for convolution layers, beta, gamma for normalization layers. @param data The data to associated with the tensor @param device The compute device @return A Boolean value indicating whether the data is successfully associated with the tensor and copied to the device.
     */
    bindAndWriteData$toDevice$(data: _MLCTensorData, device: _MLCDevice): boolean;
    /**
     * @abstract Associates the given optimizer data and device data buffers to the tensor. Returns true if the data is successfully associated with the tensor and copied to the device. @discussion The caller must guarantee the lifetime of the underlying memory of \p data for the entirety of the tensor's lifetime. The \p deviceData buffers are allocated by MLCompute. This method must be called before executeOptimizerUpdateWithOptions or executeWithInputsData is called for the training graph. @param data The optimizer data to be associated with the tensor @param deviceData The optimizer device data to be associated with the tensor @return A Boolean value indicating whether the data is successfully associated with the tensor .
     */
    bindOptimizerData$deviceData$(data: _NSArray, deviceData: _NSArray | null): boolean;
    /**
     * @abstract Converts a 32-bit floating-point tensor with given scale and a zero point Returns a quantized tensor @param type The quantized data type. Must be MLCDataTypeInt8, MLCDataTypeUInt8 or MLCDataTypeInt32 @param scale The scale to apply in quantization @param bias The offset value that maps to float zero @return A quantized tensor
     */
    tensorByQuantizingToType$scale$bias$(type: MLCDataType, scale: number, bias: number): _MLCTensor | null;
    /**
     * @abstract Converts a 32-bit floating-point tensor with given scale and a zero point Returns a quantized tensor @param type The quantized data type. Must be MLCDataTypeInt8, MLCDataTypeUInt8 or MLCDataTypeInt32 @param scale The scale to apply in quantization @param bias The offset value that maps to float zero @param axis The dimension on which to apply per-channel quantization @return A quantized tensor
     */
    tensorByQuantizingToType$scale$bias$axis$(type: MLCDataType, scale: _MLCTensor, bias: _MLCTensor, axis: number): _MLCTensor | null;
    /**
     * @abstract Converts a quantized tensor to a 32-bit floating-point tensor Returns a de-quantized tensor @param type The de-quantized data type. Must be MLCFloat32 @param scale The scale thst was used for the quantized data @param bias The offset value that maps to float zero used for the quantized data @return A quantized tensor
     */
    tensorByDequantizingToType$scale$bias$(type: MLCDataType, scale: _MLCTensor, bias: _MLCTensor): _MLCTensor | null;
    /**
     * @abstract Converts a quantized tensor to a 32-bit floating-point tensor Returns a de-quantized tensor @param type The de-quantized data type. Must be MLCFloat32 @param scale The scale thst was used for the quantized data @param bias The offset value that maps to float zero used for the quantized data @param axis The dimension on which to apply per-channel quantization @return A quantized tensor
     */
    tensorByDequantizingToType$scale$bias$axis$(type: MLCDataType, scale: _MLCTensor, bias: _MLCTensor, axis: number): _MLCTensor | null;
    /**
     * @property tensorID @abstract The tensor ID @discussion A unique number to identify each tensor. Assigned when the tensor is created.
     */
    tensorID(): number;
    /** @property descriptor @abstract The tensor descriptor */
    descriptor(): _MLCTensorDescriptor;
    /** @property data @abstract The tensor data */
    data(): _NSData | null;
    /** @property label @abstract A string to help identify this object. */
    label(): _NSString;
    setLabel$(value: _NSString): void;
    /** @property device @abstract The device associated with this tensor. */
    device(): _MLCDevice | null;
    /**
     * @property optimizer buffers to use if tensor is used as a parameter @abstract These are the host side optimizer (momentum and velocity) buffers which developers can query and initialize @discussion When customizing optimizer data, the contents of these buffers must be initialized before executing optimizer update for a graph.
     */
    optimizerData(): _NSArray;
    /**
     * @property optimizer device buffers to use if tensor is used as a parameter @abstract These are the device side optimizer (momentum and velocity) buffers which developers can query
     */
    optimizerDeviceData(): _NSArray;
    /**
     * @abstract Returns a Boolean value indicating whether the underlying data has valid floating-point numerics, i.e. it does not contain NaN or INF floating-point values.
     */
    hasValidNumerics(): boolean;
}
export interface _MLCTensor extends _NSCopying {
}
