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

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

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

Graph.close介绍

[英]Release resources associated with the Graph.

Blocks until there are no active Session instances referring to this Graph. A Graph is not usable after close returns.
[中]释放与图关联的资源。
阻塞,直到没有引用此图的活动会话实例。关闭返回后,图形不可用。

代码示例

代码示例来源:origin: org.springframework.cloud.stream.app/spring-cloud-starter-stream-processor-image-recognition

@Override
public void close() throws Exception {
  logger.info("Input Graph Destroyed");
  if (graph != null) {
    graph.close();
  }
}

代码示例来源:origin: org.springframework.cloud.stream.app/spring-cloud-starter-stream-common-tensorflow

@Override
public void close() throws Exception {
  logger.info("Close TensorFlow Graph!");
  if (graph != null) {
    graph.close();
  }
}

代码示例来源:origin: spring-cloud-stream-app-starters/tensorflow

@Override
public void close() {
  logger.info("Close TensorFlow Graph!");
  if (graph != null) {
    graph.close();
  }
}

代码示例来源:origin: spring-cloud-stream-app-starters/tensorflow

@Override
public void close() throws Exception {
  logger.info("Input Graph Destroyed");
  if (graph != null) {
    graph.close();
  }
}

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

/**
 * Releases resources (the {@link Graph} and {@link Session}) associated with the saved model
 * bundle.
 */
@Override
public void close() {
 session.close();
 graph.close();
}

代码示例来源:origin: org.bytedeco.javacpp-presets/tensorflow

/**
 * Releases resources (the {@link Graph} and {@link Session}) associated with the saved model
 * bundle.
 */
@Override
public void close() {
 session.close();
 graph.close();
}

代码示例来源:origin: spotify/zoltar

/** Close the model. */
@Override
public void close() {
 if (instance() != null) {
  LOG.debug("Closing TensorFlow session");
  instance().close();
 }
 if (graph() != null) {
  LOG.debug("Closing TensorFlow graph");
  graph().close();
 }
}

代码示例来源:origin: com.spotify/zoltar-tensorflow

/**
 * Close the model.
 */
@Override
public void close() {
 if (instance() != null) {
  LOG.debug("Closing TensorFlow session");
  instance().close();
 }
 if (graph() != null) {
  LOG.debug("Closing TensorFlow graph");
  graph().close();
 }
}

代码示例来源:origin: org.bytedeco.javacpp-presets/tensorflow

/**
 * Cleans up the state associated with this Object.
 *
 * <p>The TenosrFlowInferenceInterface object is no longer usable after this method returns.
 */
public void close() {
 closeFeeds();
 closeFetches();
 sess.close();
 g.close();
 if (runStats != null) {
  runStats.close();
 }
 runStats = null;
}

相关文章