/usr/local/lib64/python3.6/site-packages/torch/ao/quantization/__pycache__
Edit: /usr/local/lib64/python3.6/site-packages/torch/ao/quantization/__pycache__/observer.cpython-36.pyc (39227B)
3
Eg9 @ s U d dl Z d dlZd dlmZmZ d dlmZ d dlmZ d dl m
Z
mZmZm
Z
mZmZ d dlZd dljZd dlmZmZ G dd deZd d
Zdd Zeed
efi Ze
G dd deejZG dd deZG dd deZG dd deZ G dd deZ!G dd de!Z"G dd deZ#G dd deZ$G dd deZ%G d d! d!eZ&d"d# Z'd$d% Z(d&d' Z)d(d) Z*d*d+ Z+ej,d,d-Z-e$Z.e%Z/ej,ej0ej1d.Z2e#j,d,d-Z3e!j,ej0ej4d.Z5e$j,ej6ej7d/Z8e!j,ej7ej9d d0Z:dS )1 N)ABCMetaabstractmethod)OrderedDict)partial)AnyListTupleOptionalDictUnion)check_min_max_validcalculate_qmin_qmaxc @ s4 e Zd Zdd Zdd Zdd Zdd Zd d
ZdS )_PartialWrapperc C s || _ i | _d S )N)p
callable_args)selfr r J/usr/local/lib64/python3.6/site-packages/torch/ao/quantization/observer.py__init__ s z_PartialWrapper.__init__c O s8 x*| j D ] }||kr||| j | i}qW | j||S )N)r r )r argskeywordsZarg_namer r r __call__ s z_PartialWrapper.__call__c C s | j j | jj S )N)r __repr__r )r r r r r s z_PartialWrapper.__repr__c K s t | f|S )N)
_with_args)r kwargsr r r with_args s z_PartialWrapper.with_argsc K s t | jd}| j||_|S )N)r )r r r )r r resultr r r with_callable_args s z"_PartialWrapper.with_callable_argsN)__name__
__module____qualname__r r r r r r r r r r
s
r c K s t t| f|}|S )a Wrapper that allows creation of class factories.
This can be useful when there is a need to create classes with the same
constructor arguments, but different instances. Can be used in conjunction with
_callable_args
Example::
>>> Foo.with_args = classmethod(_with_args)
>>> foo_builder = Foo.with_args(a=3, b=4).with_args(answer=42)
>>> foo_instance1 = foo_builder()
>>> foo_instance2 = foo_builder()
>>> id(foo_instance1) == id(foo_instance2)
False
)r r )cls_or_selfr rr r r r &