How to convert DenseNDArray to NDArray ?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- machine-learning
Research direction
The report centers on Dataset.tfRecordDataset and the DenseNDArray, NDArray, and TString types in the Scala example. Start by tracing those APIs and the TensorFlow Java tensor-conversion documentation. Done means identifying and documenting a supported conversion path, or clearly recording that the requested conversion is unavailable.
Written by the indexing model from the issue text.
Description
HI , when I read TfRecordDataset from tfrecord file , I get the data type is DenseNDArray ,actual is DenseTString, I want to convert it to TString data.
my code -scala version
val path = "/Volumes/Pink4T/transfer/code/github/stanford-tensorflow-tutorials/2017/data/friday.tfrecord"
val dataset = Dataset.tfRecordDataset(tf,path,"",0l).batch(10) // readData(path) //
// DenseNdArray
var count =0
for (outputs <- dataset) {
try {
val batch1 = outputs.get(count).asTensor.asInstanceOf[TString]
try {
val byteNdArray:NdArray[Array[Byte]]= batch1.asBytes().asInstanceOf[NdArray[Array[Byte]]] //ByteNdArray]
val bda = byteNdArray.asInstanceOf[DenseNdArray[TString]] // here !!! how to get SparseNdArray?
println(s"bda shape ${bda.shape()} ${kk.shape()}")
count = count + 1
} finally {
if (batch1 != null) batch1.close()
}
}
}
- 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
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100