torch.ao.quantization.observer.ReuseInputObserver#

class torch.ao.quantization.observer.ReuseInputObserver[源代码]#

This observer is used when we want to reuse the observer from the operator that produces the input Tensor, typically used for operators like reshape, e.g. ` x0 = ... x1 = x0.reshape() ` if we configure x0 to be observed by some observer, let’s say MinMaxObserver, and reshape is configured with ReuseInputObserver, we’ll reuse the observer instance for x0 for x1 (output of reshape). If x0 is not observed, we also won’t observe x1.

Note: this is only enabled in FX Graph Mode Quantization