Tensor.tensorOf methods can return unzeroed memory
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- java
- Domain
- machine-learning
Research direction
Start with Tensor.of(Class, Shape, long) and Tensor.of(Class, Shape), then reproduce the issue using TFloat32.tensorOf(Shape.of(2,2)). Confirm that newly created tensors contain only zeros, including tensors created through the related tensorOf methods, and add or run a regression check if the surrounding code provides one.
Written by the indexing model from the issue text.
Description
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yep
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS
- TensorFlow installed from (source or binary): binary
- TensorFlow version (use command below): 0.3.1
Describe the current behavior
Tensor.of(Class,Shape,long) and Tensor.of(Class,Shape) return a Tensor which has not been zeroed. This is used by the various tensorOf methods on things like TFloat32.
Describe the expected behavior
Tensors should be initialised to be all zero the same way any other Java object is.
Code to reproduce the issue
Run TFloat32.tensorOf(Shape.of(2,2)) and you'll likely get some junk in there. I was allocating things (16,10) but the size is irrelevant.
I was building a one hot vector to use as the target for a training run, and I expected to get an all zero tensor back, so I only set the 1s. The model was very confused by the true labels having NaNs in.
- Dominant language
- Java
- Stars
- 928
- Forks
- 227
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tensorflow/java
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
tensorflow/java#653 · 1 comment · 4 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
tensorflow/java#621 · 4 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
tensorflow/java#617 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
tensorflow/java#615 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
tensorflow/java#614 · 1 comment ·
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
puj-course/FIS_2630_1204_G1#294 ·