Skip to content

Commit

Permalink
Add no-op writer
Browse files Browse the repository at this point in the history
  • Loading branch information
mickvangelderen committed Dec 4, 2024
1 parent 86bc9d6 commit 3365d12
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions src/jax_loop_utils/metric_writers/noop_writer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
"""No-op MetricWriter implementation."""

from collections.abc import Mapping
from typing import Any, Optional

from jax_loop_utils.metric_writers.interface import Array, MetricWriter, Scalar


class NoOpWriter(MetricWriter):
"""MetricWriter that performs no operations."""

def write_summaries(
self,
step: int,
values: Mapping[str, Array],
metadata: Optional[Mapping[str, Any]] = None,
):
pass

def write_scalars(self, step: int, scalars: Mapping[str, Scalar]):
pass

def write_images(self, step: int, images: Mapping[str, Array]):
pass

def write_videos(self, step: int, videos: Mapping[str, Array]):
pass

def write_audios(self, step: int, audios: Mapping[str, Array], *, sample_rate: int):
pass

def write_texts(self, step: int, texts: Mapping[str, str]):
pass

def write_histograms(
self,
step: int,
arrays: Mapping[str, Array],
num_buckets: Optional[Mapping[str, int]] = None,
):
pass

def write_pointcloud(
self,
step: int,
point_clouds: Mapping[str, Array],
*,
point_colors: Mapping[str, Array] | None = None,
configs: Mapping[str, str | float | bool | None] | None = None,
):
pass

def write_hparams(self, hparams: Mapping[str, Any]):
pass

def flush(self):
pass

def close(self):
pass

0 comments on commit 3365d12

Please sign in to comment.