[][src]Struct tfrecord::EventWriter

pub struct EventWriter<W> { /* fields omitted */ }

The event writer type.

The EventWriter is initialized by EventWriterInit. It provies a series write_* methods and write_*_async asynchronous analogues to append events to the file recognized by TensorBoard.

The typical usage call the EventWriterInit::from_prefix with the log directory to build a EventWriter.

use tfrecord::{EventInit, EventWriterInit};
let mut writer = EventWriterInit::default()
    .from_prefix("log_dir/myprefix-", None)
    .unwrap();
writer
    .write_scalar("my_event_name", EventInit::with_step(0), 3.14)
    .unwrap();

Implementations

impl<W> EventWriter<W> where
    W: Write
[src]

pub fn write_scalar<T>(
    &mut self,
    tag: T,
    event_init: EventInit,
    value: f32
) -> Result<(), Error> where
    T: ToString
[src]

Write a scalar summary.

pub fn write_histogram<T, H, E>(
    &mut self,
    tag: T,
    event_init: EventInit,
    histogram: H
) -> Result<(), Error> where
    T: ToString,
    H: TryInto<HistogramProto, Error = E>,
    Error: From<E>, 
[src]

Write a histogram summary.

pub fn write_tensor<T, S, E>(
    &mut self,
    tag: T,
    event_init: EventInit,
    tensor: S
) -> Result<(), Error> where
    T: ToString,
    S: TryInto<TensorProto, Error = E>,
    Error: From<E>, 
[src]

Write a tensor summary.

pub fn write_image<T, M, E>(
    &mut self,
    tag: T,
    event_init: EventInit,
    image: M
) -> Result<(), Error> where
    T: ToString,
    M: TryInto<Image, Error = E>,
    Error: From<E>, 
[src]

Write an image summary.

pub fn write_image_list<T, V, E>(
    &mut self,
    tag: T,
    event_init: EventInit,
    images: V
) -> Result<(), Error> where
    T: ToString,
    V: TryInfoImageList<Error = E>,
    Error: From<E>, 
[src]

Write a summary with multiple images.

pub fn write_audio<T, A, E>(
    &mut self,
    tag: T,
    event_init: EventInit,
    audio: A
) -> Result<(), Error> where
    T: ToString,
    A: TryInto<Audio, Error = E>,
    Error: From<E>, 
[src]

Write an audio summary.

pub fn write_event(&mut self, event: Event) -> Result<(), Error>[src]

Write a custom event.

pub fn flush(&mut self) -> Result<(), Error>[src]

Flush this output stream.

impl<W> EventWriter<W> where
    W: AsyncWriteExt + Unpin
[src]

pub async fn write_scalar_async<'_, T>(
    &'_ mut self,
    tag: T,
    event_init: EventInit,
    value: f32
) -> Result<(), Error> where
    T: ToString
[src]

Write a scalar summary asynchronously.

pub async fn write_histogram_async<'_, T, H, E>(
    &'_ mut self,
    tag: T,
    event_init: EventInit,
    histogram: H
) -> Result<(), Error> where
    T: ToString,
    H: TryInto<HistogramProto, Error = E>,
    Error: From<E>, 
[src]

Write a histogram summary asynchronously.

pub async fn write_tensor_async<'_, T, S, E>(
    &'_ mut self,
    tag: T,
    event_init: EventInit,
    tensor: S
) -> Result<(), Error> where
    T: ToString,
    S: TryInto<TensorProto, Error = E>,
    Error: From<E>, 
[src]

Write a tensor summary asynchronously.

pub async fn write_image_async<'_, T, M, E>(
    &'_ mut self,
    tag: T,
    event_init: EventInit,
    image: M
) -> Result<(), Error> where
    T: ToString,
    M: TryInto<Image, Error = E>,
    Error: From<E>, 
[src]

Write an image summary asynchronously.

pub async fn write_image_list_async<'_, T, V, E>(
    &'_ mut self,
    tag: T,
    event_init: EventInit,
    images: V
) -> Result<(), Error> where
    T: ToString,
    V: TryInfoImageList<Error = E>,
    Error: From<E>, 
[src]

Write a summary with multiple images asynchronously.

pub async fn write_audio_async<'_, T, A, E>(
    &'_ mut self,
    tag: T,
    event_init: EventInit,
    audio: A
) -> Result<(), Error> where
    T: ToString,
    A: TryInto<Audio, Error = E>,
    Error: From<E>, 
[src]

Write an audio summary asynchronously.

pub async fn write_event_async<'_>(
    &'_ mut self,
    event: Event
) -> Result<(), Error>
[src]

Write a custom event asynchronously.

pub async fn flush_async<'_>(&'_ mut self) -> Result<(), Error>[src]

Flush this output stream asynchronously.

Trait Implementations

impl<W: Clone> Clone for EventWriter<W>[src]

impl<W: Debug> Debug for EventWriter<W>[src]

impl<W: PartialEq> PartialEq<EventWriter<W>> for EventWriter<W>[src]

impl<W> StructuralPartialEq for EventWriter<W>[src]

Auto Trait Implementations

impl<W> RefUnwindSafe for EventWriter<W> where
    W: RefUnwindSafe

impl<W> Send for EventWriter<W> where
    W: Send

impl<W> Sync for EventWriter<W> where
    W: Sync

impl<W> Unpin for EventWriter<W> where
    W: Unpin

impl<W> UnwindSafe for EventWriter<W> where
    W: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.