support patchbased inference and se block graph optimization

This commit is contained in:
meenchen
2022-12-10 00:44:55 -05:00
parent b5d75b0e61
commit f7b7f4fd5a
9 changed files with 511 additions and 233 deletions

View File

@@ -165,3 +165,11 @@ class PatchResizer:
_changeOPTensorSize(self.layer[i], "input", 1, layer_info["input_h"], layer_info["input_w"])
else:
layer_info["is_patch"] = False
# We need to cut off the link between patch blocks and normal inference blocks,
# so the memory buffers can be allocated successfully
if PatchLayers > 0:
self.layer[PatchLayers].params["input_idx"] = (
str(self.layer[PatchLayers].params["input_idx"]) + "_start_normal_infernece_block"
)
self.layer[PatchLayers].input_tensors[0].graph_idx = self.layer[PatchLayers].params["input_idx"]