nncf/torch/quantization/layers.py
def from_state(cls, state: Dict) -> 'PTQuantizerSetup':
        """
        Creates the object from its state.

        :param state: Output of `get_state()` method.
        """

        def decode_qp(pair):
            str_qp_id, qp_state = pair
            return int(str_qp_id), PTQuantizationPoint.from_state(qp_state)

        def list2set(pair):
            str_idx, qp_id_list = pair
            return int(str_idx), set(qp_id_list)

        unified_scale_groups = dict(map(list2set, state[cls._state_names.UNIFIED_SCALE_GROUPS].items()))
        shared_input_operation_set_groups_state = state[cls._state_names.SHARED_INPUT_OPERATION_SET_GROUPS]
        setup = PTQuantizerSetup(unified_scale_groups, shared_input_operation_set_groups_state)
        setup.quantization_points = dict(map(decode_qp, state[cls._state_names.QUANTIZATION_POINTS].items()))
        setup.shared_input_operation_set_groups = dict(map(list2set, shared_input_operation_set_groups_state.items()))
        return setup

        Creates the object from its state.

        :param state: Output of `get_state()` method.
        
Creates the object from its state.
Creates the object from its state .
def from_state(cls, state: Dict) -> 'PTQuantizerSetup':
        def decode_qp(pair):
            str_qp_id, qp_state = pair
            return int(str_qp_id), PTQuantizationPoint.from_state(qp_state)
        def list2set(pair):
            str_idx, qp_id_list = pair
            return int(str_idx), set(qp_id_list)
        unified_scale_groups = dict(map(list2set, state[cls._state_names.UNIFIED_SCALE_GROUPS].items()))
        shared_input_operation_set_groups_state = state[cls._state_names.SHARED_INPUT_OPERATION_SET_GROUPS]
        setup = PTQuantizerSetup(unified_scale_groups, shared_input_operation_set_groups_state)
        setup.quantization_points = dict(map(decode_qp, state[cls._state_names.QUANTIZATION_POINTS].items()))
        setup.shared_input_operation_set_groups = dict(map(list2set, shared_input_operation_set_groups_state.items()))
        return setup
def from_state ( cls , state : Dict ) -> 'PTQuantizerSetup' : def decode_qp ( pair ) : str_qp_id , qp_state = pair return int ( str_qp_id ) , PTQuantizationPoint . from_state ( qp_state ) def list2set ( pair ) : str_idx , qp_id_list = pair return int ( str_idx ) , set ( qp_id_list ) unified_scale_groups = dict ( map ( list2set , state [ cls . _state_names . UNIFIED_SCALE_GROUPS ] . items ( ) ) ) shared_input_operation_set_groups_state = state [ cls . _state_names . SHARED_INPUT_OPERATION_SET_GROUPS ] setup = PTQuantizerSetup ( unified_scale_groups , shared_input_operation_set_groups_state ) setup . quantization_points = dict ( map ( decode_qp , state [ cls . _state_names . QUANTIZATION_POINTS ] . items ( ) ) ) setup . shared_input_operation_set_groups = dict ( map ( list2set , shared_input_operation_set_groups_state . items ( ) ) ) return setup
Creates the object from its state.
Creates the object from its state .
"""
        Creates the object from its state.

        :param state: Output of `get_state()` method.
        """
cls
state
Dict
Output of `get_state()` method.
Output of ` get_state () ` method .