Skip to content

Commit

Permalink
Add wandb log function
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul-tuli committed Jan 2, 2024
1 parent 459c9fe commit 43c7057
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/sparseml/core/logger/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,6 +1344,23 @@ def add_scalars(
tag=tag, values=values, step=step, wall_time=wall_time, **kwargs
)

def log(
self,
data: Dict[str, Any],
step: Optional[int] = None,
tag: Optional[str] = DEFAULT_TAG,
**kwargs,
) -> None:
"""
:param data: A dict of serializable python objects i.e `str`,
`ints`, `floats`, `Tensors`, `dicts`, etc
:param step: global step for when the values were taken
:param tag: identifying tag to log the values with, defaults to DEFAULT_TAG
:param kwargs: additional logging arguments to support
Python and custom loggers
"""
self.log_scalars(tag=tag, values=data, step=step, **kwargs)


def _create_dirs(path: str):
path = Path(path).expanduser().absolute()
Expand Down

0 comments on commit 43c7057

Please sign in to comment.