From 7aae8f9c7930a98b8b901549130bd54444c1804e Mon Sep 17 00:00:00 2001 From: Ryan Nett Date: Mon, 18 Jan 2021 21:59:48 -0800 Subject: [PATCH 1/2] Clairify tensorOf lifetime requirements Signed-off-by: Ryan Nett --- .../src/main/java/org/tensorflow/op/core/Constant.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Constant.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Constant.java index 1b6aee0284b..918f9083923 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Constant.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Constant.java @@ -1278,7 +1278,8 @@ public static Constant tensorOf(Scope scope, Shape shape) { } /** - * Create a constant by making an immutable copy of {@code tensor}. + * Create a constant by making an immutable copy of {@code tensor}. {@code tensor} may be closed afterwards without + * issue. * *

Note: this endpoint cannot be simply called {@code constant} since it will conflict with * other endpoints accepting an NdArray in parameter {e.g. {@link #tensorOf(Scope, FloatNdArray)}}. From 5b0d486c5ccd1ce07251322118c88dc47b747e84 Mon Sep 17 00:00:00 2001 From: Ryan Nett Date: Mon, 18 Jan 2021 22:03:50 -0800 Subject: [PATCH 2/2] Do codegen Signed-off-by: Ryan Nett --- .../src/gen/annotations/org/tensorflow/op/Ops.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java index cf7c5b47030..23ca3497412 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java @@ -1867,7 +1867,8 @@ public Constant constant(Class type, Shape shape, ByteDa } /** - * Create a constant by making an immutable copy of {@code tensor}. + * Create a constant by making an immutable copy of {@code tensor}. {@code tensor} may be closed afterwards without + * issue. * *

Note: this endpoint cannot be simply called {@code constant} since it will conflict with * other endpoints accepting an NdArray in parameter {e.g. {@link #tensorOf(Scope, FloatNdArray)}}.