|
19 | 19 |
|
20 | 20 | import java.nio.charset.Charset;
|
21 | 21 | import java.util.List;
|
| 22 | +import java.util.Map; |
| 23 | +import org.tensorflow.ConcreteFunction; |
22 | 24 | import org.tensorflow.DeviceSpec;
|
23 | 25 | import org.tensorflow.EagerSession;
|
24 | 26 | import org.tensorflow.ExecutionEnvironment;
|
|
87 | 89 | import org.tensorflow.op.core.ExtractVolumePatches;
|
88 | 90 | import org.tensorflow.op.core.Fill;
|
89 | 91 | import org.tensorflow.op.core.Fingerprint;
|
| 92 | +import org.tensorflow.op.core.Function; |
90 | 93 | import org.tensorflow.op.core.Gather;
|
91 | 94 | import org.tensorflow.op.core.GatherNd;
|
92 | 95 | import org.tensorflow.op.core.GetSessionHandle;
|
@@ -1116,6 +1119,31 @@ public Bucketize bucketize(Operand<? extends TNumber> input, List<Float> boundar
|
1116 | 1119 | return Bucketize.create(scope, input, boundaries);
|
1117 | 1120 | }
|
1118 | 1121 |
|
| 1122 | + /** |
| 1123 | + * Calls the function in an execution environment, adding its graph as a function if it isn't |
| 1124 | + * already present. Only works for functions with a single input and output. |
| 1125 | + * |
| 1126 | + * @param argument the argument to the call |
| 1127 | + * @return the output of the function |
| 1128 | + * @see ConcreteFunction#call(Ops, Operand) |
| 1129 | + */ |
| 1130 | + public Operand<?> call(ConcreteFunction function, Operand<?> argument) { |
| 1131 | + return Function.call(scope, function, argument); |
| 1132 | + } |
| 1133 | + |
| 1134 | + /** |
| 1135 | + * Calls the function in an execution environment, adding its graph as a function if it isn't |
| 1136 | + * already present. The inputs and outputs are keyed by the names set in the {@code Signature}. |
| 1137 | + * |
| 1138 | + * @param arguments the arguments to the call |
| 1139 | + * @return the outputs of the function |
| 1140 | + * @see ConcreteFunction#call(Ops, Map) |
| 1141 | + */ |
| 1142 | + public Map<String, Operand<?>> call(ConcreteFunction function, |
| 1143 | + Map<String, Operand<?>> arguments) { |
| 1144 | + return Function.call(scope, function, arguments); |
| 1145 | + } |
| 1146 | + |
1119 | 1147 | /**
|
1120 | 1148 | * Clips tensor values to a specified min and max.
|
1121 | 1149 | * Given a tensor {@code t}, this operation returns a tensor of the same type and
|
|
0 commit comments