(onnx_graph, name, verbose)
| 64 | |
| 65 | |
| 66 | def optimize(onnx_graph, name, verbose): |
| 67 | opt = Optimizer(onnx_graph, verbose=verbose) |
| 68 | opt.info(name + ": original") |
| 69 | opt.cleanup() |
| 70 | opt.info(name + ": cleanup") |
| 71 | opt.fold_constants() |
| 72 | opt.info(name + ": fold constants") |
| 73 | # opt.infer_shapes() |
| 74 | # opt.info(name + ': shape inference') |
| 75 | onnx_opt_graph = opt.cleanup(return_onnx=True) |
| 76 | opt.info(name + ": finished") |
| 77 | return onnx_opt_graph |
| 78 | |
| 79 | |
| 80 | class UNet2DConditionControlNetModel(torch.nn.Module): |
no test coverage detected