public final class TensorMap extends Object implements AutoCloseable
Constructor and Description |
---|
TensorMap(Map<String,org.tensorflow.Tensor> map)
Creates a new TensorMap wrapping the supplied map.
|
TensorMap(String inputName,
org.tensorflow.Tensor value)
Creates a TensorMap containing the supplied mapping.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
org.tensorflow.Session.Runner |
feedInto(org.tensorflow.Session.Runner runner)
Feeds the tensors in this FeedDict into the runner.
|
Map<String,org.tensorflow.Tensor> |
getMap()
Returns the underlying immutable map.
|
Optional<org.tensorflow.Tensor> |
getTensor(String key)
Returns the specified tensor if present.
|
String |
toString() |
public TensorMap(String inputName, org.tensorflow.Tensor value)
inputName
- The input name.value
- The tensor value.public Map<String,org.tensorflow.Tensor> getMap()
public Optional<org.tensorflow.Tensor> getTensor(String key)
key
- The key to lookup.public org.tensorflow.Session.Runner feedInto(org.tensorflow.Session.Runner runner)
If the session does not have placeholders with the names used in this TensorMap
then the Session.Runner
will throw IllegalArgumentException
.
runner
- The session runner.public void close()
close
in interface AutoCloseable
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.