Class RustLibrary

java.lang.Object
ai.djl.engine.rust.RustLibrary

public final class RustLibrary extends Object
Rust native library.
  • Method Summary

    Modifier and Type
    Method
    Description
    static long
    abs(long handle)
     
    static long
    acos(long handle)
     
    static long
    adaptiveAvgPool(long handle, long[] shape)
     
    static long
    adaptiveMaxPool(long handle, long[] shape)
     
    static long
    add(long handle, long other)
     
    static long
    arange(float start, float stop, float step, int dataType, String deviceType, int deviceId)
     
    static long
    argMax(long handle)
     
    static long
    argMaxWithAxis(long handle, int axis, boolean keepDims)
     
    static long
    argMin(long handle)
     
    static long
    argMinWithAxis(long handle, int axis, boolean keepDims)
     
    static long
    argSort(long handle, int axis, boolean ascending)
     
    static long
    asin(long handle)
     
    static long
    atan(long handle)
     
    static long
    atan2(long handle, long other)
     
    static long
    avgPool2d(long handle, long[] kernelShape, long[] stride)
     
    static long
    batchMatMul(long handle, long other)
     
    static long
    booleanMask(long handle, long indexHandle, int axis)
     
    static long
    broadcast(long handle, long[] shape)
     
    static long
    ceil(long handle)
     
    static long
    clip(long handle, double min, double max)
     
    static long
    complex(long handle)
     
    static long
    concat(long[] srcArray, int axis)
     
    static boolean
    contentEqual(long handle, long other)
     
    static long
    cos(long handle)
     
    static long
    cosh(long handle)
     
    static long
    countNonzero(long handle)
     
    static long
    countNonzeroWithAxis(long handle, int axis)
     
    static long
    cumProd(long handle, int axis)
     
    static long
    cumProdWithAxis(long handle, int axis, boolean keepDims)
     
    static long
    cumProdWithType(long handle, int axis, int dataType)
     
    static long
    cumSum(long handle, int axis)
     
    static long
    deleteModel(long handle)
     
    static void
    deleteTensor(long handle)
     
    static long
    div(long handle, long other)
     
    static long
    dot(long handle, long other)
     
    static long
    duplicate(long handle)
     
    static long
    elu(long handle, float alpha)
     
    static long
    eq(long handle, long other)
     
    static long
    erf(long handle)
     
    static long
    erfinv(long handle)
     
    static long
    exp(long handle)
     
    static long
    expandDims(long handle, int axis)
     
    static long
    eye(int rows, int cols, int dataType, String deviceType, int deviceId)
     
    static long
    flatten(long handle)
     
    static long
    flattenWithDims(long handle, int startDim, int endDim)
     
    static long
    flip(long handle, int[] axes)
     
    static long
    floor(long handle)
     
    static long
    full(float value, long[] shape, int dataType, String deviceType, int deviceId)
     
    static long
    fullSlice(long handle, long[] min, long[] max, long[] step)
     
    static long
    gather(long handle, long indexHandle, int axis)
     
    static long
    gelu(long handle)
     
    static int
    getDataType(long handle)
     
    static int[]
    getDevice(long handle)
     
    static String[]
    getInputNames(long handle)
     
    static long[]
    getShape(long handle)
     
    static long
    gt(long handle, long other)
     
    static long
    gte(long handle, long other)
     
    static long
    hannWindow(long numPoints, String deviceType, int deviceId)
     
    static long
    inverse(long handle)
     
    static boolean
     
    static long
    isInf(long handle)
     
    static long
    isNaN(long handle)
     
    static long
    leakyRelu(long handle, float alpha)
     
    static long
    linspace(float start, float stop, int num, int dataType, String deviceType, int deviceId)
     
    static long
    loadModel(String modelPath, int dtype, String deviceType, int deviceId)
     
    static long
    log(long handle)
     
    static long
    log10(long handle)
     
    static long
    log2(long handle)
     
    static long
    logicalAnd(long handle, long other)
     
    static long
    logicalNot(long handle)
     
    static long
    logicalOr(long handle, long other)
     
    static long
    logicalXor(long handle, long other)
     
    static long
    logSoftmax(long handle, int axis)
     
    static long
    lpPool(long handle, float normType, long[] kernelShape, long[] stride, boolean ceilMode)
     
    static long
    lt(long handle, long other)
     
    static long
    lte(long handle, long other)
     
    static long
    matmul(long handle, long other)
     
    static long
    max(long handle)
     
    static long
    maximum(long handle, long other)
     
    static long
    maxPool(long handle, long[] kernelShape, long[] stride, long[] padding, boolean ceilMode)
     
    static long
    maxWithAxis(long handle, int axis, boolean keepDims)
     
    static long
    mean(long handle)
     
    static long
    meanWithAxis(long handle, int[] axis, boolean keepDims)
     
    static long[]
    median(long handle, int axis, boolean keepDims)
     
    static long
    min(long handle)
     
    static long
    minimum(long handle, long other)
     
    static long
    minWithAxis(long handle, int axis, boolean keepDims)
     
    static long
    mul(long handle, long other)
     
    static long
    neg(long handle)
     
    static long
    neq(long handle, long other)
     
    static long
    nonZero(long handle)
     
    static long
    norm(long handle, int i, int[] ints, boolean keepDims)
     
    static long
    normalize(long handle, double p, long dim, double eps)
     
    static long
    oneHot(long handle, int depth, float onValue, float offValue, int dataType)
     
    static long
    ones(long[] shape, int dType, String deviceType, int deviceId)
     
    static long
    percentile(long handle)
     
    static long
    percentileWithAxes(long handle, double percentile, int[] axes)
     
    static long
    permute(long handle, int[] axes)
     
    static long
    pick(long handle, long pickHandle, int axis)
     
    static long
    pow(long handle, long other)
     
    static long
    prod(long handle)
     
    static long
    put(long handle, long indexHandle, long valueHandle)
     
    static long
    randint(long low, long high, long[] shape, int dataType, String deviceType, int deviceId)
     
    static long
    randomNormal(float loc, float scale, long[] shape, int dataType, String deviceType, int deviceId)
     
    static long
    randomPermutation(long n, String deviceType, int deviceId)
     
    static long
    real(long handle)
     
    static long
    relu(long handle)
     
    static long
    remainder(long handle, long other)
     
    static long
    repeat(long handle, long repeat, int axis)
     
    static long
    reshape(long handle, long[] shape)
     
    static long
    rot90(long handle, int times, int[] axes)
     
    static long
    round(long handle)
     
    static long
    runInference(long handle, long[] inputHandles)
     
    static long
    scatter(long handle, long indexHandle, long valueHandle, int axis)
     
    static long
    selu(long handle)
     
    static long
    sigmoid(long handle)
     
    static long
    sign(long handle)
     
    static long
    sin(long handle)
     
    static long
    sinh(long handle)
     
    static long
    softmax(long handle, int axis)
     
    static long
    softPlus(long handle)
     
    static long
    softSign(long handle)
     
    static long
    sort(long handle, int axis, boolean ascending)
     
    static long[]
    split(long handle, long[] indices, int axis)
     
    static long
    sqrt(long handle)
     
    static long
    square(long handle)
     
    static long
    squeeze(long handle, int[] axes)
     
    static long
    stack(long[] srcArray, int axis)
     
    static long
    sub(long handle, long other)
     
    static long
    sum(long handle)
     
    static long
    sumWithAxis(long handle, int[] axes, boolean keepDims)
     
    static long
    take(long handle, long indexHandle)
     
    static long
    tan(long handle)
     
    static long
    tanh(long handle)
     
    static long
    tensorOf(ByteBuffer buf, long[] shape, int dataType, String deviceType, int deviceId)
     
    static long
    tile(long handle, long[] repeats)
     
    static long
    tileWithAxis(long handle, int axis, long repeat)
     
    static long
    tileWithShape(long handle, long[] shape)
     
    static long
    toBoolean(long handle)
     
    static byte[]
    toByteArray(long handle)
     
    static long
    toDataType(long handle, int dataType)
     
    static long
    toDevice(long handle, String deviceType, int deviceId)
     
    static long[]
    topK(long handle, int k, int axis, boolean largest, boolean sorted)
     
    static long
    transpose(long handle, int axis1, int axis2)
     
    static long
    trunc(long handle)
     
    static long
    uniform(float low, float high, long[] shape, int dataType, String deviceType, int deviceId)
     
    static long
    where(long conditionHandle, long handle, long otherHandle)
     
    static long
    xlogy(long handle, long other)
     
    static long
    zeros(long[] shape, int dataType, String deviceType, int deviceId)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isCudaAvailable

      public static boolean isCudaAvailable()
    • loadModel

      public static long loadModel(String modelPath, int dtype, String deviceType, int deviceId)
    • deleteModel

      public static long deleteModel(long handle)
    • getInputNames

      public static String[] getInputNames(long handle)
    • runInference

      public static long runInference(long handle, long[] inputHandles)
    • tensorOf

      public static long tensorOf(ByteBuffer buf, long[] shape, int dataType, String deviceType, int deviceId)
    • zeros

      public static long zeros(long[] shape, int dataType, String deviceType, int deviceId)
    • ones

      public static long ones(long[] shape, int dType, String deviceType, int deviceId)
    • full

      public static long full(float value, long[] shape, int dataType, String deviceType, int deviceId)
    • arange

      public static long arange(float start, float stop, float step, int dataType, String deviceType, int deviceId)
    • eye

      public static long eye(int rows, int cols, int dataType, String deviceType, int deviceId)
    • linspace

      public static long linspace(float start, float stop, int num, int dataType, String deviceType, int deviceId)
    • randint

      public static long randint(long low, long high, long[] shape, int dataType, String deviceType, int deviceId)
    • randomPermutation

      public static long randomPermutation(long n, String deviceType, int deviceId)
    • uniform

      public static long uniform(float low, float high, long[] shape, int dataType, String deviceType, int deviceId)
    • randomNormal

      public static long randomNormal(float loc, float scale, long[] shape, int dataType, String deviceType, int deviceId)
    • hannWindow

      public static long hannWindow(long numPoints, String deviceType, int deviceId)
    • deleteTensor

      public static void deleteTensor(long handle)
    • getDataType

      public static int getDataType(long handle)
    • getDevice

      public static int[] getDevice(long handle)
    • getShape

      public static long[] getShape(long handle)
    • duplicate

      public static long duplicate(long handle)
    • toDevice

      public static long toDevice(long handle, String deviceType, int deviceId)
    • toBoolean

      public static long toBoolean(long handle)
    • toDataType

      public static long toDataType(long handle, int dataType)
    • toByteArray

      public static byte[] toByteArray(long handle)
    • fullSlice

      public static long fullSlice(long handle, long[] min, long[] max, long[] step)
    • gather

      public static long gather(long handle, long indexHandle, int axis)
    • take

      public static long take(long handle, long indexHandle)
    • put

      public static long put(long handle, long indexHandle, long valueHandle)
    • scatter

      public static long scatter(long handle, long indexHandle, long valueHandle, int axis)
    • booleanMask

      public static long booleanMask(long handle, long indexHandle, int axis)
    • contentEqual

      public static boolean contentEqual(long handle, long other)
    • eq

      public static long eq(long handle, long other)
    • neq

      public static long neq(long handle, long other)
    • gt

      public static long gt(long handle, long other)
    • gte

      public static long gte(long handle, long other)
    • lt

      public static long lt(long handle, long other)
    • lte

      public static long lte(long handle, long other)
    • add

      public static long add(long handle, long other)
    • sub

      public static long sub(long handle, long other)
    • mul

      public static long mul(long handle, long other)
    • div

      public static long div(long handle, long other)
    • minimum

      public static long minimum(long handle, long other)
    • maximum

      public static long maximum(long handle, long other)
    • remainder

      public static long remainder(long handle, long other)
    • pow

      public static long pow(long handle, long other)
    • xlogy

      public static long xlogy(long handle, long other)
    • exp

      public static long exp(long handle)
    • log

      public static long log(long handle)
    • log10

      public static long log10(long handle)
    • log2

      public static long log2(long handle)
    • sin

      public static long sin(long handle)
    • cos

      public static long cos(long handle)
    • tan

      public static long tan(long handle)
    • asin

      public static long asin(long handle)
    • acos

      public static long acos(long handle)
    • atan

      public static long atan(long handle)
    • atan2

      public static long atan2(long handle, long other)
    • sinh

      public static long sinh(long handle)
    • cosh

      public static long cosh(long handle)
    • tanh

      public static long tanh(long handle)
    • abs

      public static long abs(long handle)
    • neg

      public static long neg(long handle)
    • sign

      public static long sign(long handle)
    • square

      public static long square(long handle)
    • sqrt

      public static long sqrt(long handle)
    • floor

      public static long floor(long handle)
    • ceil

      public static long ceil(long handle)
    • round

      public static long round(long handle)
    • trunc

      public static long trunc(long handle)
    • countNonzero

      public static long countNonzero(long handle)
    • countNonzeroWithAxis

      public static long countNonzeroWithAxis(long handle, int axis)
    • sum

      public static long sum(long handle)
    • sumWithAxis

      public static long sumWithAxis(long handle, int[] axes, boolean keepDims)
    • topK

      public static long[] topK(long handle, int k, int axis, boolean largest, boolean sorted)
    • max

      public static long max(long handle)
    • maxWithAxis

      public static long maxWithAxis(long handle, int axis, boolean keepDims)
    • min

      public static long min(long handle)
    • minWithAxis

      public static long minWithAxis(long handle, int axis, boolean keepDims)
    • argMax

      public static long argMax(long handle)
    • argMaxWithAxis

      public static long argMaxWithAxis(long handle, int axis, boolean keepDims)
    • argMin

      public static long argMin(long handle)
    • argMinWithAxis

      public static long argMinWithAxis(long handle, int axis, boolean keepDims)
    • percentile

      public static long percentile(long handle)
    • percentileWithAxes

      public static long percentileWithAxes(long handle, double percentile, int[] axes)
    • mean

      public static long mean(long handle)
    • meanWithAxis

      public static long meanWithAxis(long handle, int[] axis, boolean keepDims)
    • median

      public static long[] median(long handle, int axis, boolean keepDims)
    • cumProd

      public static long cumProd(long handle, int axis)
    • cumProdWithType

      public static long cumProdWithType(long handle, int axis, int dataType)
    • prod

      public static long prod(long handle)
    • cumProdWithAxis

      public static long cumProdWithAxis(long handle, int axis, boolean keepDims)
    • normalize

      public static long normalize(long handle, double p, long dim, double eps)
    • rot90

      public static long rot90(long handle, int times, int[] axes)
    • split

      public static long[] split(long handle, long[] indices, int axis)
    • flatten

      public static long flatten(long handle)
    • flattenWithDims

      public static long flattenWithDims(long handle, int startDim, int endDim)
    • reshape

      public static long reshape(long handle, long[] shape)
    • expandDims

      public static long expandDims(long handle, int axis)
    • squeeze

      public static long squeeze(long handle, int[] axes)
    • logicalAnd

      public static long logicalAnd(long handle, long other)
    • logicalOr

      public static long logicalOr(long handle, long other)
    • logicalXor

      public static long logicalXor(long handle, long other)
    • logicalNot

      public static long logicalNot(long handle)
    • argSort

      public static long argSort(long handle, int axis, boolean ascending)
    • sort

      public static long sort(long handle, int axis, boolean ascending)
    • softmax

      public static long softmax(long handle, int axis)
    • logSoftmax

      public static long logSoftmax(long handle, int axis)
    • cumSum

      public static long cumSum(long handle, int axis)
    • isInf

      public static long isInf(long handle)
    • isNaN

      public static long isNaN(long handle)
    • tile

      public static long tile(long handle, long[] repeats)
    • tileWithAxis

      public static long tileWithAxis(long handle, int axis, long repeat)
    • tileWithShape

      public static long tileWithShape(long handle, long[] shape)
    • repeat

      public static long repeat(long handle, long repeat, int axis)
    • dot

      public static long dot(long handle, long other)
    • matmul

      public static long matmul(long handle, long other)
    • batchMatMul

      public static long batchMatMul(long handle, long other)
    • clip

      public static long clip(long handle, double min, double max)
    • transpose

      public static long transpose(long handle, int axis1, int axis2)
    • flip

      public static long flip(long handle, int[] axes)
    • permute

      public static long permute(long handle, int[] axes)
    • broadcast

      public static long broadcast(long handle, long[] shape)
    • nonZero

      public static long nonZero(long handle)
    • inverse

      public static long inverse(long handle)
    • norm

      public static long norm(long handle, int i, int[] ints, boolean keepDims)
    • oneHot

      public static long oneHot(long handle, int depth, float onValue, float offValue, int dataType)
    • complex

      public static long complex(long handle)
    • real

      public static long real(long handle)
    • sigmoid

      public static long sigmoid(long handle)
    • softPlus

      public static long softPlus(long handle)
    • softSign

      public static long softSign(long handle)
    • leakyRelu

      public static long leakyRelu(long handle, float alpha)
    • elu

      public static long elu(long handle, float alpha)
    • selu

      public static long selu(long handle)
    • relu

      public static long relu(long handle)
    • gelu

      public static long gelu(long handle)
    • erf

      public static long erf(long handle)
    • erfinv

      public static long erfinv(long handle)
    • maxPool

      public static long maxPool(long handle, long[] kernelShape, long[] stride, long[] padding, boolean ceilMode)
    • adaptiveMaxPool

      public static long adaptiveMaxPool(long handle, long[] shape)
    • avgPool2d

      public static long avgPool2d(long handle, long[] kernelShape, long[] stride)
    • adaptiveAvgPool

      public static long adaptiveAvgPool(long handle, long[] shape)
    • lpPool

      public static long lpPool(long handle, float normType, long[] kernelShape, long[] stride, boolean ceilMode)
    • where

      public static long where(long conditionHandle, long handle, long otherHandle)
    • stack

      public static long stack(long[] srcArray, int axis)
    • concat

      public static long concat(long[] srcArray, int axis)
    • pick

      public static long pick(long handle, long pickHandle, int axis)