patrickpjiang:

could not export python function call <python_value>. Remove calls to Python functions before export. Did you forget add @script or @script_method annotation? If this is a nn.ModuleList, add it to constants.:


The error message says that you have a function that you did not provide script annotation. In your case you will need to script TopPoolFunction and TopPool to make the model to be exported.