Search in sources :

Example 1 with TFE_TensorHandle

use of org.tensorflow.internal.c_api.TFE_TensorHandle in project djl by deepjavalibrary.

the class TfNDArray method powi.

/**
 * {@inheritDoc}
 */
@Override
public NDArray powi(NDArray other) {
    TFE_TensorHandle newHandle = manager.opExecutor("Pow").addInput(this).addInput(other).buildRawPointer(1)[0];
    setHandle(newHandle);
    return this;
}
Also used : TFE_TensorHandle(org.tensorflow.internal.c_api.TFE_TensorHandle)

Example 2 with TFE_TensorHandle

use of org.tensorflow.internal.c_api.TFE_TensorHandle in project djl by deepjavalibrary.

the class TfNDArray method signi.

/**
 * {@inheritDoc}
 */
@Override
public NDArray signi() {
    TFE_TensorHandle newHandle = manager.opExecutor("Sign").addInput(this).buildRawPointer(1)[0];
    setHandle(newHandle);
    return this;
}
Also used : TFE_TensorHandle(org.tensorflow.internal.c_api.TFE_TensorHandle)

Example 3 with TFE_TensorHandle

use of org.tensorflow.internal.c_api.TFE_TensorHandle in project djl by deepjavalibrary.

the class TfNDArray method negi.

/**
 * {@inheritDoc}
 */
@Override
public NDArray negi() {
    TFE_TensorHandle newHandle = manager.opExecutor("Neg").addInput(this).buildRawPointer(1)[0];
    setHandle(newHandle);
    return this;
}
Also used : TFE_TensorHandle(org.tensorflow.internal.c_api.TFE_TensorHandle)

Example 4 with TFE_TensorHandle

use of org.tensorflow.internal.c_api.TFE_TensorHandle in project djl by deepjavalibrary.

the class TfNDArray method addi.

/**
 * {@inheritDoc}
 */
@Override
public NDArray addi(NDArray other) {
    TFE_TensorHandle newHandle = manager.opExecutor("Add").addInput(this).addInput(other).buildRawPointer(1)[0];
    setHandle(newHandle);
    return this;
}
Also used : TFE_TensorHandle(org.tensorflow.internal.c_api.TFE_TensorHandle)

Example 5 with TFE_TensorHandle

use of org.tensorflow.internal.c_api.TFE_TensorHandle in project djl by deepjavalibrary.

the class TfNDArrayEx method rpowi.

/**
 * {@inheritDoc}
 */
@Override
public NDArray rpowi(Number n) {
    TfNDManager manager = array.getManager();
    try (NDArray temp = manager.create(n);
        NDArray casted = temp.toType(array.getDataType(), false)) {
        TFE_TensorHandle newHandle = manager.opExecutor("Pow").addInput(casted).addInput(array).buildRawPointer(1)[0];
        array.setHandle(newHandle);
        return array;
    }
}
Also used : TFE_TensorHandle(org.tensorflow.internal.c_api.TFE_TensorHandle) NDArray(ai.djl.ndarray.NDArray)

Aggregations

TFE_TensorHandle (org.tensorflow.internal.c_api.TFE_TensorHandle)22 PointerScope (org.bytedeco.javacpp.PointerScope)7 TF_Status (org.tensorflow.internal.c_api.TF_Status)7 AbstractTFE_TensorHandle (org.tensorflow.internal.c_api.AbstractTFE_TensorHandle)5 PointerPointer (org.bytedeco.javacpp.PointerPointer)4 BytePointer (org.bytedeco.javacpp.BytePointer)3 Pointer (org.bytedeco.javacpp.Pointer)3 AbstractTF_Tensor (org.tensorflow.internal.c_api.AbstractTF_Tensor)3 TF_Tensor (org.tensorflow.internal.c_api.TF_Tensor)3 NDArray (ai.djl.ndarray.NDArray)2 IntPointer (org.bytedeco.javacpp.IntPointer)2 TF_TString (org.tensorflow.internal.c_api.TF_TString)2 Device (ai.djl.Device)1 DataType (ai.djl.ndarray.types.DataType)1 JavacppUtils (ai.djl.tensorflow.engine.javacpp.JavacppUtils)1 Pair (ai.djl.util.Pair)1 Preconditions (ai.djl.util.Preconditions)1 ByteBuffer (java.nio.ByteBuffer)1 StandardCharsets (java.nio.charset.StandardCharsets)1 Arrays (java.util.Arrays)1