Description
I want to include the “surgeon sanitize” of polygraphy in my python script, but I don’t find the way to do that.
Is it possible to do that? there is API fot the sanitize option?
Environment
NA
Relevant Files
NA
Steps To Reproduce
NA
The easiest way would be to run it using subprocess:
sp.run(["polygraphy", "surgeon", "sanitize", ...])
Otherwise, you can refer to the source code here to see what it’s doing.
Assuming you just want the constant folding functionality, something like this should work:
from polygraphy.backend.onnx import fold_constants
model = onnx.load("/path/to/model.onnx")
folded = fold_constants(model)
Thank you, that’s what I was looking for
system
Closed
September 14, 2022, 7:05am
7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.