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

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

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

Graph.ref介绍

暂无

代码示例

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

/** Wrap an existing session with the associated {@link Graph}. */
Session(Graph g, long nativeHandle) {
 graph = g;
 this.nativeHandle = nativeHandle;
 graphRef = g.ref();
}

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

/** Wrap an existing session with the associated {@link Graph}. */
Session(Graph g, long nativeHandle) {
 graph = g;
 this.nativeHandle = nativeHandle;
 graphRef = g.ref();
}

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

public OperationBuilder setDevice(String device) {
 Graph.Reference r = graph.ref();
 try {
  setDevice(unsafeNativeHandle, device);
 } finally {
  r.close();
 }
 return this;
}

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

public OperationBuilder setAttr(String name, long[] value) {
 Graph.Reference r = graph.ref();
 try {
  setAttrIntList(unsafeNativeHandle, name, value);
 } finally {
  r.close();
 }
 return this;
}

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

public OperationBuilder setAttr(String name, float[] value) {
 Graph.Reference r = graph.ref();
 try {
  setAttrFloatList(unsafeNativeHandle, name, value);
 } finally {
  r.close();
 }
 return this;
}

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

/** Returns the number of tensors produced by this operation. */
public int numOutputs() {
 Graph.Reference r = graph.ref();
 try {
  return numOutputs(unsafeNativeHandle);
 } finally {
  r.close();
 }
}

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

public OperationBuilder setDevice(String device) {
 Graph.Reference r = graph.ref();
 try {
  setDevice(unsafeNativeHandle, device);
 } finally {
  r.close();
 }
 return this;
}

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

/** Returns the full name of the Operation. */
public String name() {
 Graph.Reference r = graph.ref();
 try {
  return name(unsafeNativeHandle);
 } finally {
  r.close();
 }
}

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

public OperationBuilder setAttr(String name, byte[] value) {
 Graph.Reference r = graph.ref();
 try {
  setAttrString(unsafeNativeHandle, name, value);
 } finally {
  r.close();
 }
 return this;
}

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

/** Returns the full name of the Operation. */
public String name() {
 Graph.Reference r = graph.ref();
 try {
  return name(unsafeNativeHandle);
 } finally {
  r.close();
 }
}

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

/**
 * Returns the type of the operation, i.e., the name of the computation performed by the
 * operation.
 */
public String type() {
 Graph.Reference r = graph.ref();
 try {
  return type(unsafeNativeHandle);
 } finally {
  r.close();
 }
}

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

public OperationBuilder setAttr(String name, float[] value) {
 Graph.Reference r = graph.ref();
 try {
  setAttrFloatList(unsafeNativeHandle, name, value);
 } finally {
  r.close();
 }
 return this;
}

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

public OperationBuilder setAttr(String name, boolean[] value) {
 Graph.Reference r = graph.ref();
 try {
  setAttrBoolList(unsafeNativeHandle, name, value);
 } finally {
  r.close();
 }
 return this;
}

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

public OperationBuilder setAttr(String name, Tensor<?> value) {
 Graph.Reference r = graph.ref();
 try {
  setAttrTensor(unsafeNativeHandle, name, value.getNativeHandle());
 } finally {
  r.close();
 }
 return this;
}

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

OperationBuilder(Graph graph, String type, String name) {
 this.graph = graph;
 Graph.Reference r = graph.ref();
 try {
  this.unsafeNativeHandle = allocate(r.nativeHandle(), type, name);
 } finally {
  r.close();
 }
}

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

public OperationBuilder setAttr(String name, DataType value) {
 Graph.Reference r = graph.ref();
 try {
  setAttrType(unsafeNativeHandle, name, value.c());
 } finally {
  r.close();
 }
 return this;
}

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

public OperationBuilder setAttr(String name, DataType value) {
 Graph.Reference r = graph.ref();
 try {
  setAttrType(unsafeNativeHandle, name, value.c());
 } finally {
  r.close();
 }
 return this;
}

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

public OperationBuilder setAttr(String name, Tensor<?> value) {
 Graph.Reference r = graph.ref();
 try {
  setAttrTensor(unsafeNativeHandle, name, value.getNativeHandle());
 } finally {
  r.close();
 }
 return this;
}

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

long[] shape(int output) {
 Graph.Reference r = graph.ref();
 try {
  return shape(r.nativeHandle(), unsafeNativeHandle, output);
 } finally {
  r.close();
 }
}

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

long[] shape(int output) {
 Graph.Reference r = graph.ref();
 try {
  return shape(r.nativeHandle(), unsafeNativeHandle, output);
 } finally {
  r.close();
 }
}

相关文章