Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yolov5 quant #32

Open
wm901115nwpu opened this issue Jul 21, 2022 · 0 comments
Open

yolov5 quant #32

wm901115nwpu opened this issue Jul 21, 2022 · 0 comments

Comments

@wm901115nwpu
Copy link

def permute_preds(self, mlvl_preds):
permute_mlvl_preds = []
for loc_pred, cls_pred, obj_pred in mlvl_preds:
bs, ls, ny, nx = loc_pred.shape
cs = cls_pred.shape[1]
loc_pred = loc_pred.view(bs, self.num_anchors_per_level,
ls // self.num_anchors_per_level, ny, nx).permute(0, 1, 3, 4, 2).contiguous()
cls_pred = cls_pred.view(bs, self.num_anchors_per_level,
cs // self.num_anchors_per_level, ny, nx).permute(0, 1, 3, 4, 2).contiguous()
obj_pred = obj_pred.view(bs, self.num_anchors_per_level,
1, ny, nx).permute(0, 1, 3, 4, 2).contiguous()
permute_mlvl_preds.append((loc_pred, cls_pred, obj_pred))
return permute_mlvl_preds

torch.fx.tracer proxy iterated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant