core.modules.scaling.compat#

Copyright (c) Meta Platforms, Inc. and affiliates.

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Attributes#

Functions#

_load_scale_dict(scale_file)

Loads scale factors from either:

load_scales_compat(→ None)

Module Contents#

core.modules.scaling.compat.ScaleDict#
core.modules.scaling.compat._load_scale_dict(scale_file: str | ScaleDict | None)#

Loads scale factors from either: - a JSON file mapping scale factor names to scale values - a python dictionary pickled object (loaded using torch.load) mapping scale factor names to scale values - a dictionary mapping scale factor names to scale values

core.modules.scaling.compat.load_scales_compat(module: torch.nn.Module, scale_file: str | ScaleDict | None) None#