用法
@tf_contextlib.contextmanager
stop_recording()
生成(Yield)
- None
拋出
-
RuntimeError
如果磁帶當前沒有錄製。
暫時停止此磁帶上的錄製操作。
此上下文管理器處於活動狀態時執行的操作不會記錄在磁帶上。這對於減少跟蹤所有計算所使用的內存很有用。
例如:
x = tf.constant(4.0)
with tf.GradientTape() as tape:
with tape.stop_recording():
y = x ** 2
dy_dx = tape.gradient(y, x)
print(dy_dx)
None
相關用法
- Python tf.GradientTape.jacobian用法及代碼示例
- Python tf.GradientTape.reset用法及代碼示例
- Python tf.GradientTape.batch_jacobian用法及代碼示例
- Python tf.GradientTape用法及代碼示例
- Python tf.Graph.control_dependencies用法及代碼示例
- Python tf.Graph.container用法及代碼示例
- Python tf.Graph.as_default用法及代碼示例
- Python tf.Graph.device用法及代碼示例
- Python tf.Graph用法及代碼示例
- Python tf.Graph.get_name_scope用法及代碼示例
- Python tf.Graph.gradient_override_map用法及代碼示例
- Python tf.Graph.name_scope用法及代碼示例
- Python tf.Graph.colocate_with用法及代碼示例
- Python tf.compat.v1.distributions.Multinomial.stddev用法及代碼示例
- Python tf.compat.v1.distribute.MirroredStrategy.experimental_distribute_dataset用法及代碼示例
- Python tf.compat.v1.data.TFRecordDataset.interleave用法及代碼示例
- Python tf.summary.scalar用法及代碼示例
- Python tf.linalg.LinearOperatorFullMatrix.matvec用法及代碼示例
- Python tf.linalg.LinearOperatorToeplitz.solve用法及代碼示例
- Python tf.raw_ops.TPUReplicatedInput用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.GradientTape.stop_recording。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。