用法
@abc.abstractmethod
get_value(
name=None
)
參數
-
name
(可選。)創建的操作的名稱。
返回
- 包裝的值。
返回此可選包裝的值。
如果此可選值沒有值(即 self.has_value()
計算結果為 False
),則此操作將在運行時引發 tf.errors.InvalidArgumentError
。
optional = tf.experimental.Optional.from_value(42)
print(optional.get_value())
tf.Tensor(42, shape=(), dtype=int32)
相關用法
- Python tf.experimental.Optional.has_value用法及代碼示例
- Python tf.experimental.Optional.empty用法及代碼示例
- Python tf.experimental.Optional.from_value用法及代碼示例
- Python tf.experimental.dlpack.from_dlpack用法及代碼示例
- Python tf.experimental.numpy.iinfo用法及代碼示例
- Python tf.experimental.dispatch_for_unary_elementwise_apis用法及代碼示例
- Python tf.experimental.dispatch_for_api用法及代碼示例
- Python tf.experimental.unregister_dispatch_for用法及代碼示例
- Python tf.experimental.tensorrt.Converter用法及代碼示例
- Python tf.experimental.ExtensionType用法及代碼示例
- Python tf.experimental.numpy.issubdtype用法及代碼示例
- Python tf.experimental.numpy.unicode_用法及代碼示例
- Python tf.experimental.dlpack.to_dlpack用法及代碼示例
- Python tf.experimental.async_scope用法及代碼示例
- Python tf.experimental.numpy.float16.as_integer_ratio用法及代碼示例
- Python tf.experimental.numpy.float64.as_integer_ratio用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.experimental.Optional.get_value。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。