* Get the feed value for given key. * @param key The SymbolicTensor, or its name (as a string), of which the * value is sought. * @returns If `key` exists, the corresponding feed value. * @throws ValueError: If `key` does not exist in this `FeedDict`.
(key: SymbolicTensor|string)
| 137 | * @throws ValueError: If `key` does not exist in this `FeedDict`. |
| 138 | */ |
| 139 | getValue(key: SymbolicTensor|string): Tensor { |
| 140 | if (key instanceof SymbolicTensor) { |
| 141 | if (this.id2Value[key.id] == null) { |
| 142 | throw new ValueError(`Nonexistent key: ${key.name}`); |
| 143 | } else { |
| 144 | return this.id2Value[key.id]; |
| 145 | } |
| 146 | } else { |
| 147 | const id = this.name2Id[key]; |
| 148 | if (id == null) { |
| 149 | throw new ValueError(`Feed dict has no SymbolicTensor name: ${key}`); |
| 150 | } |
| 151 | return this.id2Value[id]; |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * Get the feed mask for given key. |
no outgoing calls
no test coverage detected