Skip to main content

LoggingBackend

Trait LoggingBackend 

Source
pub trait LoggingBackend {
    // Required methods
    fn log_scalar(
        &mut self,
        name: &str,
        value: f64,
        step: usize,
    ) -> TrainResult<()>;
    fn log_text(&mut self, message: &str) -> TrainResult<()>;
    fn flush(&mut self) -> TrainResult<()>;
}
Expand description

Trait for logging backends.

Required Methods§

Source

fn log_scalar(&mut self, name: &str, value: f64, step: usize) -> TrainResult<()>

Log a scalar metric.

§Arguments
  • name - Name of the metric
  • value - Value of the metric
  • step - Training step/epoch number
Source

fn log_text(&mut self, message: &str) -> TrainResult<()>

Log a text message.

§Arguments
  • message - Text message to log
Source

fn flush(&mut self) -> TrainResult<()>

Flush any buffered logs.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl LoggingBackend for Box<dyn LoggingBackendClone>

Source§

fn log_scalar(&mut self, name: &str, value: f64, step: usize) -> TrainResult<()>

Source§

fn log_text(&mut self, message: &str) -> TrainResult<()>

Source§

fn flush(&mut self) -> TrainResult<()>

Implementors§