cerebras.modelzoo.tools.checkpoint_converters.streaming_checkpoints.OnDemandDictionaryConverter#

class cerebras.modelzoo.tools.checkpoint_converters.streaming_checkpoints.OnDemandDictionaryConverter(underlying_dict, converter_class, action_fn_args=None)[source]#

Bases: object

Wraps around an input dictionary in order to transform its values on-the-fly. The transformation has the following restrictions: 1. It must maintain a 1-1 mapping (i.e. no new/dropped keys) 2. The keys cannot change names (only values can change) There is error checking during object initialization and during runtime to ensure that this restriction holds.

Parameters
  • underlying_dict – Underlying dictionary that needs to be transformed in an on-demand fashion

  • converter_class – A subclass of BaseDictionaryConverter which describes the transformation of the underlying dictionary

  • action_fn_args – Additional arguments that may be used in the converter’s action functions.

Methods

items

keys

values

verify_converter