pub struct TensorBoardWriter { /* private fields */ }Expand description
Writes TensorBoard-compatible event files in TFRecord format.
Implementations§
Source§impl TensorBoardWriter
impl TensorBoardWriter
Sourcepub fn new(log_dir: impl AsRef<Path>) -> Result<Self, ModelError>
pub fn new(log_dir: impl AsRef<Path>) -> Result<Self, ModelError>
Create a new writer that stores events under log_dir.
Creates log_dir if it does not exist and writes the initial
file_version event required by TensorBoard.
Sourcepub fn add_scalar(
&mut self,
tag: &str,
value: f32,
step: i64,
) -> Result<(), ModelError>
pub fn add_scalar( &mut self, tag: &str, value: f32, step: i64, ) -> Result<(), ModelError>
Log a scalar value with the given tag and step.
Sourcepub fn flush(&mut self) -> Result<(), ModelError>
pub fn flush(&mut self) -> Result<(), ModelError>
Flush buffered data to disk.
Auto Trait Implementations§
impl Freeze for TensorBoardWriter
impl RefUnwindSafe for TensorBoardWriter
impl Send for TensorBoardWriter
impl Sync for TensorBoardWriter
impl Unpin for TensorBoardWriter
impl UnsafeUnpin for TensorBoardWriter
impl UnwindSafe for TensorBoardWriter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more