Expose the track-op method. (#1148)

This commit is contained in:
Laurent Mazare
2023-10-22 06:57:03 +01:00
committed by GitHub
parent 5b32c2a41e
commit 62fc965617

View File

@ -449,7 +449,7 @@ impl Tensor {
/// Returns true if the computation graph should track this op, that is if it is /// Returns true if the computation graph should track this op, that is if it is
/// a variable or if it has some variable as dependencies. /// a variable or if it has some variable as dependencies.
pub(crate) fn track_op(&self) -> bool { pub fn track_op(&self) -> bool {
self.is_variable || self.op.is_some() self.is_variable || self.op.is_some()
} }