When I use hook to get output param , but get Proxy() , Why?

when I use the hook to get output param, but the param’s type is Proxy.

def hook_get_output(module,  input, output):
    print(output)

for name, layer in module.named_modules():
     layer.register_forward_hook(hook_get_output)

notes: the module is quantization_module

Are you using FX graph mode quantization to symbolically trace through the model? If yes, then you are expected to see Proxy objects in the process of symbolic tracing.

If not, could you provide some additional context on what you are feeding through the model after you set up the hook?

1 Like

Thanks, m friend. I made a mistake :sweat_smile: