Java Code Examples for org.tensorflow.Operation#outputListLength()

The following examples show how to use org.tensorflow.Operation#outputListLength() . 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: ParseExample.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ParseExample(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int sparseIndicesLength = operation.outputListLength("sparse_indices");
  sparseIndices = Arrays.asList((Output<TInt64>[])operation.outputList(outputIdx, sparseIndicesLength));
  outputIdx += sparseIndicesLength;
  int sparseValuesLength = operation.outputListLength("sparse_values");
  sparseValues = Arrays.asList(operation.outputList(outputIdx, sparseValuesLength));
  outputIdx += sparseValuesLength;
  int sparseShapesLength = operation.outputListLength("sparse_shapes");
  sparseShapes = Arrays.asList((Output<TInt64>[])operation.outputList(outputIdx, sparseShapesLength));
  outputIdx += sparseShapesLength;
  int denseValuesLength = operation.outputListLength("dense_values");
  denseValues = Arrays.asList(operation.outputList(outputIdx, denseValuesLength));
  outputIdx += denseValuesLength;
  int raggedValuesLength = operation.outputListLength("ragged_values");
  raggedValues = Arrays.asList(operation.outputList(outputIdx, raggedValuesLength));
  outputIdx += raggedValuesLength;
  int raggedRowSplitsLength = operation.outputListLength("ragged_row_splits");
  raggedRowSplits = Arrays.asList(operation.outputList(outputIdx, raggedRowSplitsLength));
  outputIdx += raggedRowSplitsLength;
}
 
Example 2
Source File: BoostedTreesCalculateBestGainsPerFeature.java    From java with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private BoostedTreesCalculateBestGainsPerFeature(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int nodeIdsListLength = operation.outputListLength("node_ids_list");
  nodeIdsList = Arrays.asList((Output<TInt32>[])operation.outputList(outputIdx, nodeIdsListLength));
  outputIdx += nodeIdsListLength;
  int gainsListLength = operation.outputListLength("gains_list");
  gainsList = Arrays.asList((Output<TFloat32>[])operation.outputList(outputIdx, gainsListLength));
  outputIdx += gainsListLength;
  int thresholdsListLength = operation.outputListLength("thresholds_list");
  thresholdsList = Arrays.asList((Output<TInt32>[])operation.outputList(outputIdx, thresholdsListLength));
  outputIdx += thresholdsListLength;
  int leftNodeContribsListLength = operation.outputListLength("left_node_contribs_list");
  leftNodeContribsList = Arrays.asList((Output<TFloat32>[])operation.outputList(outputIdx, leftNodeContribsListLength));
  outputIdx += leftNodeContribsListLength;
  int rightNodeContribsListLength = operation.outputListLength("right_node_contribs_list");
  rightNodeContribsList = Arrays.asList((Output<TFloat32>[])operation.outputList(outputIdx, rightNodeContribsListLength));
  outputIdx += rightNodeContribsListLength;
}
 
Example 3
Source File: Unstack.java    From java with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
private Unstack(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int outputLength = operation.outputListLength("output");
  output = Arrays.asList((Output<T>[])operation.outputList(outputIdx, outputLength));
  outputIdx += outputLength;
}
 
Example 4
Source File: RaggedGather.java    From java with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
private RaggedGather(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int outputNestedSplitsLength = operation.outputListLength("output_nested_splits");
  outputNestedSplits = Arrays.asList((Output<T>[])operation.outputList(outputIdx, outputNestedSplitsLength));
  outputIdx += outputNestedSplitsLength;
  outputDenseValues = operation.output(outputIdx++);
}
 
Example 5
Source File: RemoteFusedGraphExecute.java    From java with Apache License 2.0 5 votes vote down vote up
private RemoteFusedGraphExecute(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int outputsLength = operation.outputListLength("outputs");
  outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength));
  outputIdx += outputsLength;
}
 
Example 6
Source File: CtcBeamSearchDecoder.java    From java with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
private CtcBeamSearchDecoder(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int decodedIndicesLength = operation.outputListLength("decoded_indices");
  decodedIndices = Arrays.asList((Output<TInt64>[])operation.outputList(outputIdx, decodedIndicesLength));
  outputIdx += decodedIndicesLength;
  int decodedValuesLength = operation.outputListLength("decoded_values");
  decodedValues = Arrays.asList((Output<TInt64>[])operation.outputList(outputIdx, decodedValuesLength));
  outputIdx += decodedValuesLength;
  int decodedShapeLength = operation.outputListLength("decoded_shape");
  decodedShape = Arrays.asList((Output<TInt64>[])operation.outputList(outputIdx, decodedShapeLength));
  outputIdx += decodedShapeLength;
  logProbability = operation.output(outputIdx++);
}
 
Example 7
Source File: BoostedTreesBucketize.java    From java with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
private BoostedTreesBucketize(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int bucketsLength = operation.outputListLength("buckets");
  buckets = Arrays.asList((Output<TInt32>[])operation.outputList(outputIdx, bucketsLength));
  outputIdx += bucketsLength;
}
 
Example 8
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 9
Source File: MapUnstage.java    From java with Apache License 2.0 5 votes vote down vote up
private MapUnstage(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int valuesLength = operation.outputListLength("values");
  values = Arrays.asList(operation.outputList(outputIdx, valuesLength));
  outputIdx += valuesLength;
}
 
Example 10
Source File: StagePeek.java    From java with Apache License 2.0 5 votes vote down vote up
private StagePeek(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int valuesLength = operation.outputListLength("values");
  values = Arrays.asList(operation.outputList(outputIdx, valuesLength));
  outputIdx += valuesLength;
}
 
Example 11
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 12
Source File: IteratorGetNext.java    From java with Apache License 2.0 5 votes vote down vote up
private IteratorGetNext(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int componentsLength = operation.outputListLength("components");
  components = Arrays.asList(operation.outputList(outputIdx, componentsLength));
  outputIdx += componentsLength;
}
 
Example 13
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 14
Source File: RaggedTensorFromVariant.java    From java with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
private RaggedTensorFromVariant(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int outputNestedSplitsLength = operation.outputListLength("output_nested_splits");
  outputNestedSplits = Arrays.asList((Output<U>[])operation.outputList(outputIdx, outputNestedSplitsLength));
  outputIdx += outputNestedSplitsLength;
  outputDenseValues = operation.output(outputIdx++);
}
 
Example 15
Source File: OutfeedDequeueTuple.java    From java with Apache License 2.0 5 votes vote down vote up
private OutfeedDequeueTuple(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int outputsLength = operation.outputListLength("outputs");
  outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength));
  outputIdx += outputsLength;
}
 
Example 16
Source File: IdentityN.java    From java with Apache License 2.0 5 votes vote down vote up
private IdentityN(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int outputLength = operation.outputListLength("output");
  output = Arrays.asList(operation.outputList(outputIdx, outputLength));
  outputIdx += outputLength;
}
 
Example 17
Source File: MapUnstageNoKey.java    From java with Apache License 2.0 5 votes vote down vote up
private MapUnstageNoKey(Operation operation) {
  super(operation);
  int outputIdx = 0;
  key = operation.output(outputIdx++);
  int valuesLength = operation.outputListLength("values");
  values = Arrays.asList(operation.outputList(outputIdx, valuesLength));
  outputIdx += valuesLength;
}
 
Example 18
Source File: SparseSplit.java    From java with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
private SparseSplit(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int outputIndicesLength = operation.outputListLength("output_indices");
  outputIndices = Arrays.asList((Output<TInt64>[])operation.outputList(outputIdx, outputIndicesLength));
  outputIdx += outputIndicesLength;
  int outputValuesLength = operation.outputListLength("output_values");
  outputValues = Arrays.asList((Output<T>[])operation.outputList(outputIdx, outputValuesLength));
  outputIdx += outputValuesLength;
  int outputShapeLength = operation.outputListLength("output_shape");
  outputShape = Arrays.asList((Output<TInt64>[])operation.outputList(outputIdx, outputShapeLength));
  outputIdx += outputShapeLength;
}
 
Example 19
Source File: SdcaOptimizer.java    From java with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
private SdcaOptimizer(Operation operation) {
  super(operation);
  int outputIdx = 0;
  outExampleStateData = operation.output(outputIdx++);
  int outDeltaSparseWeightsLength = operation.outputListLength("out_delta_sparse_weights");
  outDeltaSparseWeights = Arrays.asList((Output<TFloat32>[])operation.outputList(outputIdx, outDeltaSparseWeightsLength));
  outputIdx += outDeltaSparseWeightsLength;
  int outDeltaDenseWeightsLength = operation.outputListLength("out_delta_dense_weights");
  outDeltaDenseWeights = Arrays.asList((Output<TFloat32>[])operation.outputList(outputIdx, outDeltaDenseWeightsLength));
  outputIdx += outDeltaDenseWeightsLength;
}
 
Example 20
Source File: ParseSequenceExample.java    From java with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
private ParseSequenceExample(Operation operation) {
  super(operation);
  int outputIdx = 0;
  int contextSparseIndicesLength = operation.outputListLength("context_sparse_indices");
  contextSparseIndices = Arrays.asList((Output<TInt64>[])operation.outputList(outputIdx, contextSparseIndicesLength));
  outputIdx += contextSparseIndicesLength;
  int contextSparseValuesLength = operation.outputListLength("context_sparse_values");
  contextSparseValues = Arrays.asList(operation.outputList(outputIdx, contextSparseValuesLength));
  outputIdx += contextSparseValuesLength;
  int contextSparseShapesLength = operation.outputListLength("context_sparse_shapes");
  contextSparseShapes = Arrays.asList((Output<TInt64>[])operation.outputList(outputIdx, contextSparseShapesLength));
  outputIdx += contextSparseShapesLength;
  int contextDenseValuesLength = operation.outputListLength("context_dense_values");
  contextDenseValues = Arrays.asList(operation.outputList(outputIdx, contextDenseValuesLength));
  outputIdx += contextDenseValuesLength;
  int contextRaggedValuesLength = operation.outputListLength("context_ragged_values");
  contextRaggedValues = Arrays.asList(operation.outputList(outputIdx, contextRaggedValuesLength));
  outputIdx += contextRaggedValuesLength;
  int contextRaggedRowSplitsLength = operation.outputListLength("context_ragged_row_splits");
  contextRaggedRowSplits = Arrays.asList(operation.outputList(outputIdx, contextRaggedRowSplitsLength));
  outputIdx += contextRaggedRowSplitsLength;
  int featureListSparseIndicesLength = operation.outputListLength("feature_list_sparse_indices");
  featureListSparseIndices = Arrays.asList((Output<TInt64>[])operation.outputList(outputIdx, featureListSparseIndicesLength));
  outputIdx += featureListSparseIndicesLength;
  int featureListSparseValuesLength = operation.outputListLength("feature_list_sparse_values");
  featureListSparseValues = Arrays.asList(operation.outputList(outputIdx, featureListSparseValuesLength));
  outputIdx += featureListSparseValuesLength;
  int featureListSparseShapesLength = operation.outputListLength("feature_list_sparse_shapes");
  featureListSparseShapes = Arrays.asList((Output<TInt64>[])operation.outputList(outputIdx, featureListSparseShapesLength));
  outputIdx += featureListSparseShapesLength;
  int featureListDenseValuesLength = operation.outputListLength("feature_list_dense_values");
  featureListDenseValues = Arrays.asList(operation.outputList(outputIdx, featureListDenseValuesLength));
  outputIdx += featureListDenseValuesLength;
  int featureListDenseLengthsLength = operation.outputListLength("feature_list_dense_lengths");
  featureListDenseLengths = Arrays.asList((Output<TInt64>[])operation.outputList(outputIdx, featureListDenseLengthsLength));
  outputIdx += featureListDenseLengthsLength;
  int featureListRaggedValuesLength = operation.outputListLength("feature_list_ragged_values");
  featureListRaggedValues = Arrays.asList(operation.outputList(outputIdx, featureListRaggedValuesLength));
  outputIdx += featureListRaggedValuesLength;
  int featureListRaggedOuterSplitsLength = operation.outputListLength("feature_list_ragged_outer_splits");
  featureListRaggedOuterSplits = Arrays.asList(operation.outputList(outputIdx, featureListRaggedOuterSplitsLength));
  outputIdx += featureListRaggedOuterSplitsLength;
  int featureListRaggedInnerSplitsLength = operation.outputListLength("feature_list_ragged_inner_splits");
  featureListRaggedInnerSplits = Arrays.asList(operation.outputList(outputIdx, featureListRaggedInnerSplitsLength));
  outputIdx += featureListRaggedInnerSplitsLength;
}