Still able to access raw tensor data after close() is called
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- java
- Lĩnh vực
- machine-learning
Hướng nghiên cứu
Bắt đầu bằng cách lần theo các điểm vào Tensor.close() và Tensor.asRawTensor().data() liên quan đến reproduction được cung cấp, bao gồm cả vòng đời của ConcreteFunction.close(). Xác nhận rằng việc truy cập dữ liệu thô sau output.close() tạo ra IllegalStateException như mong đợi, và thêm hoặc cập nhật coverage cho hành vi này nếu tìm thấy các test liên quan.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
System information
- Have I written custom code: see simple test case below to reproduce
- OS Platform and Distribution: Windows 10, 64-bit operating system, x64-based processor
- TensorFlow installed from (source or binary): binary via Maven
- TensorFlow version: v0.4.1
- Java version (i.e., the output of
java -version): AdoptOpenJDK-11.0.11+9 - Java command line flags (e.g., GC parameters): N/A
- CUDA/cuDNN version: N/A - using pure CPU version
- GPU model and memory: N/A - using pure CPU version
Describe the current behavior
After closing a tensor output from a concrete function (and the concrete function itself), am still able to access the tensor's raw data.
Describe the expected behavior
Expect an IllegalStateException when accessing the raw tensor data because close() was already called on the tensor.
Code to reproduce the issue
// Create simple (a + b) function
ConcreteFunction addTwoInts = ConcreteFunction.create((tf) -> {
Placeholder<TInt32> inputA = tf.placeholder(TInt32.class);
Placeholder<TInt32> inputB = tf.placeholder(TInt32.class);
Add<TInt32> output = tf.math.add(inputA, inputB);
return Signature.builder().key("add")
.input("a", inputA)
.input("b", inputB)
.output("out", output)
.build();
});
// Apply to input
Map<String, Tensor> input = Map.of(
"a", TInt32.scalarOf(1),
"b", TInt32.scalarOf(2));
Tensor output = addTwoInts.call(input).get("out");
// Close everything
addTwoInts.close();
output.close();
// Expect java.lang.IllegalStateException: close() was called on the Tensor
output.asRawTensor().data(); // However, no exception is thrown here
Have recently upgraded from v0.2.0, where the same test case setup would throw the excepted exception.
- Ngôn ngữ chính
- Java
- Star
- 928
- Fork
- 227
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của tensorflow/java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
tensorflow/java#653 · 1 bình luận · 4 reaction ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
tensorflow/java#621 · 4 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
tensorflow/java#617 · 3 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
tensorflow/java#615 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
tensorflow/java#614 · 1 bình luận ·
Tất cả issue của tensorflow/java
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
infinispan/infinispan#18150 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
opensearch-project/k-NN#3597 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100