nemo_automodel.shared.utils

View as Markdown

Module Contents

Functions

NameDescription
dtype_from_strTranslate a str val of a dtype into the corresponding torch.dtype

API

nemo_automodel.shared.utils.dtype_from_str(
val,
default = torch.bfloat16
)

Translate a str val of a dtype into the corresponding torch.dtype Args: val (str): the dotted path of the dtype (e.g., β€œtorch.bfloat16”).

Returns:

torch.dtype: the actual dtype (e.g., torch.bfloat16)