TrainingExtensions/tensorflow/src/python/aimet_tensorflow/quantsim.py
def update_tensor_quantizer_references(quant_sim_sess: tf.compat.v1.Session, quantizer_dict: Dict[str, QuantizerInfo]):
    """
    updates the param / activation quant ops in the passed-in session with new tensor quantizer references.
    :param quant_sim_sess: tensorflow session held by quantsim object
    :param quantizer_dict: dictionary with quant ops and associated quantizer info
    :return: None, updates passed-in session quant ops with new tensor quantizer references.
    """

    vars_with_value = {}
    for q_op_name in quantizer_dict:
        # also update the session held by tensor quantizer object
        quantizer_dict[q_op_name].session = quant_sim_sess
        tensor_quantizer_ref = libpymo.PtrToInt64(quantizer_dict[q_op_name].tensor_quantizer)
        vars_with_value[q_op_name + '_quant_ref'] = tensor_quantizer_ref

    update_variables_with_values(quant_sim_sess, vars_with_value)

    updates the param / activation quant ops in the passed-in session with new tensor quantizer references.
    :param quant_sim_sess: tensorflow session held by quantsim object
    :param quantizer_dict: dictionary with quant ops and associated quantizer info
    :return: None, updates passed-in session quant ops with new tensor quantizer references.
    
updates the param / activation quant ops in the passed-in session with new tensor quantizer references.
updates the param / activation quant ops in the passed - in session with new tensor quantizer references .
def update_tensor_quantizer_references(quant_sim_sess: tf.compat.v1.Session, quantizer_dict: Dict[str, QuantizerInfo]):
    vars_with_value = {}
    for q_op_name in quantizer_dict:
        quantizer_dict[q_op_name].session = quant_sim_sess
        tensor_quantizer_ref = libpymo.PtrToInt64(quantizer_dict[q_op_name].tensor_quantizer)
        vars_with_value[q_op_name + '_quant_ref'] = tensor_quantizer_ref
    update_variables_with_values(quant_sim_sess, vars_with_value)
def update_tensor_quantizer_references ( quant_sim_sess : tf . compat . v1 . Session , quantizer_dict : Dict [ str , QuantizerInfo ] ) : vars_with_value = { } for q_op_name in quantizer_dict : quantizer_dict [ q_op_name ] . session = quant_sim_sess tensor_quantizer_ref = libpymo . PtrToInt64 ( quantizer_dict [ q_op_name ] . tensor_quantizer ) vars_with_value [ q_op_name + '_quant_ref' ] = tensor_quantizer_ref update_variables_with_values ( quant_sim_sess , vars_with_value )
updates the param / activation quant ops in the passed-in session with new tensor quantizer references.
updates the param / activation quant ops in the passed - in session with new tensor quantizer references .
"""
    updates the param / activation quant ops in the passed-in session with new tensor quantizer references.
    :param quant_sim_sess: tensorflow session held by quantsim object
    :param quantizer_dict: dictionary with quant ops and associated quantizer info
    :return: None, updates passed-in session quant ops with new tensor quantizer references.
    """ # also update the session held by tensor quantizer object
None, updates passed-in session quant ops with new tensor quantizer references.
None updates passed - in session quant ops with new tensor quantizer references .
quant_sim_sess
tf.compat.v1.Session
tensorflow session held by quantsim object
tensorflow session held by quantsim object
quantizer_dict
Dict[str, QuantizerInfo]
dictionary with quant ops and associated quantizer info
dictionary with quant ops and associated quantizer info