org.tensorflow.Operation Java Examples

The following examples show how to use org.tensorflow.Operation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LSTMBlockCell.java    From java with Apache License 2.0 5 votes vote down vote up
private LSTMBlockCell(Operation operation) {
  super(operation);
  int outputIdx = 0;
  i = operation.output(outputIdx++);
  cs = operation.output(outputIdx++);
  f = operation.output(outputIdx++);
  o = operation.output(outputIdx++);
  ci = operation.output(outputIdx++);
  co = operation.output(outputIdx++);
  h = operation.output(outputIdx++);
}
 
Example #2
Source File: ShapeN.java    From java with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
private ShapeN(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int outputLength = operation.outputListLength("output");
  output = Arrays.asList((Output<U>[])operation.outputList(outputIdx, outputLength));
  outputIdx += outputLength;
}
 
Example #3
Source File: TfNDArray.java    From djl with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
<T extends TType> Operand<T> asOperand() {
    if (operand == null) {
        Operation op =
                manager.getEagerSession()
                        .opBuilder("Const", "Const_" + TfNDManager.nextNameAssignment())
                        .setAttr("dtype", tensor.dataType())
                        .setAttr("value", tensor)
                        .setDevice(getTfDevice())
                        .build();
        operand = op.output(0);
    }
    return (Operand<T>) operand;
}
 
Example #4
Source File: RaggedTensorToSparse.java    From java with Apache License 2.0 5 votes vote down vote up
private RaggedTensorToSparse(Operation operation) {
  super(operation);
  int outputIdx = 0;
  sparseIndices = operation.output(outputIdx++);
  sparseValues = operation.output(outputIdx++);
  sparseDenseShape = operation.output(outputIdx++);
}
 
Example #5
Source File: Requantize.java    From java with Apache License 2.0 5 votes vote down vote up
private Requantize(Operation operation) {
  super(operation);
  int outputIdx = 0;
  output = operation.output(outputIdx++);
  outputMin = operation.output(outputIdx++);
  outputMax = operation.output(outputIdx++);
}
 
Example #6
Source File: QuantizedMatMulWithBiasAndRelu.java    From java with Apache License 2.0 5 votes vote down vote up
private QuantizedMatMulWithBiasAndRelu(Operation operation) {
  super(operation);
  int outputIdx = 0;
  out = operation.output(outputIdx++);
  minOut = operation.output(outputIdx++);
  maxOut = operation.output(outputIdx++);
}
 
Example #7
Source File: Restore.java    From java with Apache License 2.0 5 votes vote down vote up
private Restore(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int tensorsLength = operation.outputListLength("tensors");
  tensors = Arrays.asList(operation.outputList(outputIdx, tensorsLength));
  outputIdx += tensorsLength;
}
 
Example #8
Source File: Quantize.java    From java with Apache License 2.0 5 votes vote down vote up
private Quantize(Operation operation) {
  super(operation);
  int outputIdx = 0;
  output = operation.output(outputIdx++);
  outputMin = operation.output(outputIdx++);
  outputMax = operation.output(outputIdx++);
}
 
Example #9
Source File: RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.java    From java with Apache License 2.0 5 votes vote down vote up
private RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug(Operation operation) {
  super(operation);
  int outputIdx = 0;
  parameters = operation.output(outputIdx++);
  accumulators = operation.output(outputIdx++);
  updates = operation.output(outputIdx++);
  gradientAccumulators = operation.output(outputIdx++);
}
 
Example #10
Source File: DecodeCsv.java    From java with Apache License 2.0 5 votes vote down vote up
private DecodeCsv(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int outputLength = operation.outputListLength("output");
  output = Arrays.asList(operation.outputList(outputIdx, outputLength));
  outputIdx += outputLength;
}
 
Example #11
Source File: QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.java    From java with Apache License 2.0 5 votes vote down vote up
private QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize(Operation operation) {
  super(operation);
  int outputIdx = 0;
  output = operation.output(outputIdx++);
  minOutput = operation.output(outputIdx++);
  maxOutput = operation.output(outputIdx++);
}
 
Example #12
Source File: LeakyRelu.java    From java with Apache License 2.0 4 votes vote down vote up
private LeakyRelu(Operation operation) {
  super(operation);
  int outputIdx = 0;
  activations = operation.output(outputIdx++);
}
 
Example #13
Source File: InfeedEnqueue.java    From java with Apache License 2.0 4 votes vote down vote up
private InfeedEnqueue(Operation operation) {
  super(operation);
}
 
Example #14
Source File: MatrixDiagPart.java    From java with Apache License 2.0 4 votes vote down vote up
private MatrixDiagPart(Operation operation) {
  super(operation);
  int outputIdx = 0;
  diagonal = operation.output(outputIdx++);
}
 
Example #15
Source File: TensorArrayClose.java    From java with Apache License 2.0 4 votes vote down vote up
private TensorArrayClose(Operation operation) {
  super(operation);
}
 
Example #16
Source File: InvGrad.java    From java with Apache License 2.0 4 votes vote down vote up
private InvGrad(Operation operation) {
  super(operation);
  int outputIdx = 0;
  z = operation.output(outputIdx++);
}
 
Example #17
Source File: StageClear.java    From java with Apache License 2.0 4 votes vote down vote up
private StageClear(Operation operation) {
  super(operation);
}
 
Example #18
Source File: Dequantize.java    From java with Apache License 2.0 4 votes vote down vote up
private Dequantize(Operation operation) {
  super(operation);
  int outputIdx = 0;
  output = operation.output(outputIdx++);
}
 
Example #19
Source File: Conv2dBackpropInput.java    From java with Apache License 2.0 4 votes vote down vote up
private Conv2dBackpropInput(Operation operation) {
  super(operation);
  int outputIdx = 0;
  output = operation.output(outputIdx++);
}
 
Example #20
Source File: CacheDataset.java    From java with Apache License 2.0 4 votes vote down vote up
private CacheDataset(Operation operation) {
  super(operation);
  int outputIdx = 0;
  handle = operation.output(outputIdx++);
}
 
Example #21
Source File: CholeskyGrad.java    From java with Apache License 2.0 4 votes vote down vote up
private CholeskyGrad(Operation operation) {
  super(operation);
  int outputIdx = 0;
  output = operation.output(outputIdx++);
}
 
Example #22
Source File: Select.java    From java with Apache License 2.0 4 votes vote down vote up
private Select(Operation operation) {
  super(operation);
  int outputIdx = 0;
  output = operation.output(outputIdx++);
}
 
Example #23
Source File: RetrieveTPUEmbeddingProximalAdagradParameters.java    From java with Apache License 2.0 4 votes vote down vote up
private RetrieveTPUEmbeddingProximalAdagradParameters(Operation operation) {
  super(operation);
  int outputIdx = 0;
  parameters = operation.output(outputIdx++);
  accumulators = operation.output(outputIdx++);
}
 
Example #24
Source File: RefMerge.java    From java with Apache License 2.0 4 votes vote down vote up
private RefMerge(Operation operation) {
  super(operation);
  int outputIdx = 0;
  output = operation.output(outputIdx++);
  valueIndex = operation.output(outputIdx++);
}
 
Example #25
Source File: ScatterMax.java    From java with Apache License 2.0 4 votes vote down vote up
private ScatterMax(Operation operation) {
  super(operation);
  int outputIdx = 0;
  outputRef = operation.output(outputIdx++);
}
 
Example #26
Source File: Mod.java    From java with Apache License 2.0 4 votes vote down vote up
private Mod(Operation operation) {
  super(operation);
  int outputIdx = 0;
  z = operation.output(outputIdx++);
}
 
Example #27
Source File: ResourceSparseApplyAdagradV2.java    From java with Apache License 2.0 4 votes vote down vote up
private ResourceSparseApplyAdagradV2(Operation operation) {
  super(operation);
}
 
Example #28
Source File: LatencyStatsDataset.java    From java with Apache License 2.0 4 votes vote down vote up
private LatencyStatsDataset(Operation operation) {
  super(operation);
  int outputIdx = 0;
  handle = operation.output(outputIdx++);
}
 
Example #29
Source File: RebatchDataset.java    From java with Apache License 2.0 4 votes vote down vote up
private RebatchDataset(Operation operation) {
  super(operation);
  int outputIdx = 0;
  handle = operation.output(outputIdx++);
}
 
Example #30
Source File: DebugIdentity.java    From java with Apache License 2.0 4 votes vote down vote up
private DebugIdentity(Operation operation) {
  super(operation);
  int outputIdx = 0;
  output = operation.output(outputIdx++);
}