Returns the last snapshot of this variable. You usually do not need to call this method as all ops that need the value of the variable call it automatically through a `convert_to_tensor()` call. Returns a `Tensor` which holds the value of the variable. You can not assign a new val
(self)
| 2134 | return self._variable |
| 2135 | |
| 2136 | def value(self): |
| 2137 | """Returns the last snapshot of this variable. |
| 2138 | |
| 2139 | You usually do not need to call this method as all ops that need the value |
| 2140 | of the variable call it automatically through a `convert_to_tensor()` call. |
| 2141 | |
| 2142 | Returns a `Tensor` which holds the value of the variable. You can not |
| 2143 | assign a new value to this tensor as it is not a reference to the variable. |
| 2144 | |
| 2145 | To avoid copies, if the consumer of the returned value is on the same device |
| 2146 | as the variable, this actually returns the live value of the variable, not |
| 2147 | a copy. Updates to the variable are seen by the consumer. If the consumer |
| 2148 | is on a different device it will get a copy of the variable. |
| 2149 | |
| 2150 | Returns: |
| 2151 | A `Tensor` containing the value of the variable. |
| 2152 | """ |
| 2153 | return self._snapshot |
| 2154 | |
| 2155 | def read_value(self): |
| 2156 | """Returns the value of this variable, read in the current context. |