org.tensorflow.Graph.opBuilder()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(9.9k)|赞(0)|评价(0)|浏览(207)

本文整理了Java中org.tensorflow.Graph.opBuilder()方法的一些代码示例,展示了Graph.opBuilder()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.opBuilder()方法的具体详情如下:
包路径:org.tensorflow.Graph
类名称:Graph
方法名:opBuilder

Graph.opBuilder介绍

[英]Returns a builder to add Operations to the Graph.
[中]返回一个生成器以向图形中添加操作。

代码示例

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new NoOp operation to the graph.
 * 
 * @param scope current graph scope
 * @return a new instance of NoOp
 */
public static NoOp create(Scope scope) {
 OperationBuilder opBuilder = scope.graph().opBuilder("NoOp", scope.makeOpName("NoOp"));
 return new NoOp(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new IsInf operation to the graph.
 * 
 * @param scope current graph scope
 * @param x 
 * @return a new instance of IsInf
 */
public static <T extends Number> IsInf create(Scope scope, Operand<T> x) {
 OperationBuilder opBuilder = scope.graph().opBuilder("IsInf", scope.makeOpName("IsInf"));
 opBuilder.addInput(x.asOutput());
 return new IsInf(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new DecodeGif operation to the graph.
 * 
 * @param scope current graph scope
 * @param contents 0-D.  The GIF-encoded image.
 * @return a new instance of DecodeGif
 */
public static DecodeGif create(Scope scope, Operand<String> contents) {
 OperationBuilder opBuilder = scope.graph().opBuilder("DecodeGif", scope.makeOpName("DecodeGif"));
 opBuilder.addInput(contents.asOutput());
 return new DecodeGif(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new GetSessionHandleV2 operation to the graph.
 * 
 * @param scope current graph scope
 * @param value The tensor to be stored.
 * @return a new instance of GetSessionHandleV2
 */
public static <T> GetSessionHandleV2 create(Scope scope, Operand<T> value) {
 OperationBuilder opBuilder = scope.graph().opBuilder("GetSessionHandleV2", scope.makeOpName("GetSessionHandleV2"));
 opBuilder.addInput(value.asOutput());
 return new GetSessionHandleV2(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new Inv operation to the graph.
 * 
 * @param scope current graph scope
 * @param x 
 * @return a new instance of Inv
 */
public static <T> Inv<T> create(Scope scope, Operand<T> x) {
 OperationBuilder opBuilder = scope.graph().opBuilder("Inv", scope.makeOpName("Inv"));
 opBuilder.addInput(x.asOutput());
 return new Inv<T>(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new StatsAggregatorSummary operation to the graph.
 * 
 * @param scope current graph scope
 * @param iterator 
 * @return a new instance of StatsAggregatorSummary
 */
public static StatsAggregatorSummary create(Scope scope, Operand<?> iterator) {
 OperationBuilder opBuilder = scope.graph().opBuilder("StatsAggregatorSummary", scope.makeOpName("StatsAggregatorSummary"));
 opBuilder.addInput(iterator.asOutput());
 return new StatsAggregatorSummary(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new GuaranteeConst operation to the graph.
 * 
 * @param scope current graph scope
 * @param input 
 * @return a new instance of GuaranteeConst
 */
public static <T> GuaranteeConst<T> create(Scope scope, Operand<T> input) {
 OperationBuilder opBuilder = scope.graph().opBuilder("GuaranteeConst", scope.makeOpName("GuaranteeConst"));
 opBuilder.addInput(input.asOutput());
 return new GuaranteeConst<T>(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new HSVToRGB operation to the graph.
 * 
 * @param scope current graph scope
 * @param images 1-D or higher rank. HSV data to convert. Last dimension must be size 3.
 * @return a new instance of HSVToRGB
 */
public static <T extends Number> HSVToRGB<T> create(Scope scope, Operand<T> images) {
 OperationBuilder opBuilder = scope.graph().opBuilder("HSVToRGB", scope.makeOpName("HSVToRGB"));
 opBuilder.addInput(images.asOutput());
 return new HSVToRGB<T>(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new LogMatrixDeterminant operation to the graph.
 * 
 * @param scope current graph scope
 * @param input Shape is `[N, M, M]`.
 * @return a new instance of LogMatrixDeterminant
 */
public static <T> LogMatrixDeterminant<T> create(Scope scope, Operand<T> input) {
 OperationBuilder opBuilder = scope.graph().opBuilder("LogMatrixDeterminant", scope.makeOpName("LogMatrixDeterminant"));
 opBuilder.addInput(input.asOutput());
 return new LogMatrixDeterminant<T>(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new OptionalHasValue operation to the graph.
 * 
 * @param scope current graph scope
 * @param optional 
 * @return a new instance of OptionalHasValue
 */
public static OptionalHasValue create(Scope scope, Operand<?> optional) {
 OperationBuilder opBuilder = scope.graph().opBuilder("OptionalHasValue", scope.makeOpName("OptionalHasValue"));
 opBuilder.addInput(optional.asOutput());
 return new OptionalHasValue(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new QueueIsClosed operation to the graph.
 * 
 * @param scope current graph scope
 * @param handle The handle to a queue.
 * @return a new instance of QueueIsClosed
 */
public static QueueIsClosed create(Scope scope, Operand<String> handle) {
 OperationBuilder opBuilder = scope.graph().opBuilder("QueueIsClosed", scope.makeOpName("QueueIsClosed"));
 opBuilder.addInput(handle.asOutput());
 return new QueueIsClosed(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new BatchMatrixDeterminant operation to the graph.
 * 
 * @param scope current graph scope
 * @param input 
 * @return a new instance of BatchMatrixDeterminant
 */
public static <T> BatchMatrixDeterminant<T> create(Scope scope, Operand<T> input) {
 OperationBuilder opBuilder = scope.graph().opBuilder("BatchMatrixDeterminant", scope.makeOpName("BatchMatrixDeterminant"));
 opBuilder.addInput(input.asOutput());
 return new BatchMatrixDeterminant<T>(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new DeleteSessionTensor operation to the graph.
 * 
 * @param scope current graph scope
 * @param handle The handle for a tensor stored in the session state.
 * @return a new instance of DeleteSessionTensor
 */
public static DeleteSessionTensor create(Scope scope, Operand<String> handle) {
 OperationBuilder opBuilder = scope.graph().opBuilder("DeleteSessionTensor", scope.makeOpName("DeleteSessionTensor"));
 opBuilder.addInput(handle.asOutput());
 return new DeleteSessionTensor(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new BatchMatrixDiagPart operation to the graph.
 * 
 * @param scope current graph scope
 * @param input 
 * @return a new instance of BatchMatrixDiagPart
 */
public static <T> BatchMatrixDiagPart<T> create(Scope scope, Operand<T> input) {
 OperationBuilder opBuilder = scope.graph().opBuilder("BatchMatrixDiagPart", scope.makeOpName("BatchMatrixDiagPart"));
 opBuilder.addInput(input.asOutput());
 return new BatchMatrixDiagPart<T>(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new ConsumeMutexLock operation to the graph.
 * 
 * @param scope current graph scope
 * @param mutexLock A tensor returned by `MutexLock`.
 * @return a new instance of ConsumeMutexLock
 */
public static ConsumeMutexLock create(Scope scope, Operand<?> mutexLock) {
 OperationBuilder opBuilder = scope.graph().opBuilder("ConsumeMutexLock", scope.makeOpName("ConsumeMutexLock"));
 opBuilder.addInput(mutexLock.asOutput());
 return new ConsumeMutexLock(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new BatchFFT2D operation to the graph.
 * 
 * @param scope current graph scope
 * @param input 
 * @return a new instance of BatchFFT2D
 */
public static BatchFFT2D create(Scope scope, Operand<?> input) {
 OperationBuilder opBuilder = scope.graph().opBuilder("BatchFFT2D", scope.makeOpName("BatchFFT2D"));
 opBuilder.addInput(input.asOutput());
 return new BatchFFT2D(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new VarIsInitializedOp operation to the graph.
 * 
 * @param scope current graph scope
 * @param resource the input resource handle.
 * @return a new instance of VarIsInitializedOp
 */
public static VarIsInitializedOp create(Scope scope, Operand<?> resource) {
 OperationBuilder opBuilder = scope.graph().opBuilder("VarIsInitializedOp", scope.makeOpName("VarIsInitializedOp"));
 opBuilder.addInput(resource.asOutput());
 return new VarIsInitializedOp(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new BatchIFFT2D operation to the graph.
 * 
 * @param scope current graph scope
 * @param input 
 * @return a new instance of BatchIFFT2D
 */
public static BatchIFFT2D create(Scope scope, Operand<?> input) {
 OperationBuilder opBuilder = scope.graph().opBuilder("BatchIFFT2D", scope.makeOpName("BatchIFFT2D"));
 opBuilder.addInput(input.asOutput());
 return new BatchIFFT2D(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

/**
 * Factory method to create a class to wrap a new SdcaFprint operation to the graph.
 * 
 * @param scope current graph scope
 * @param input vector of strings to compute fingerprints on.
 * @return a new instance of SdcaFprint
 */
public static SdcaFprint create(Scope scope, Operand<String> input) {
 OperationBuilder opBuilder = scope.graph().opBuilder("SdcaFprint", scope.makeOpName("SdcaFprint"));
 opBuilder.addInput(input.asOutput());
 return new SdcaFprint(opBuilder.build());
}

代码示例来源:origin: org.tensorflow/libtensorflow

private static <T> Constant<T> createWithTensor(Scope scope, Tensor<T> value) {
 return new Constant<T>(
   scope
     .graph()
     .opBuilder("Const", scope.makeOpName("Const"))
     .setAttr("value", value)
     .setAttr("dtype", value.dataType())
     .build());
}

相关文章