From 1993efd59e54e990add1b562ac147e57722987f9 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 10 Apr 2022 13:53:28 +0200 Subject: [PATCH] Swap `unsafe_chunk()` for `chunk()` (#7362) Eliminates all unsafe function in YOLOv5 out of an abundance of caution. --- utils/loss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/loss.py b/utils/loss.py index b5d050e..a1b0ff6 100644 --- a/utils/loss.py +++ b/utils/loss.py @@ -220,7 +220,7 @@ class ComputeLoss: offsets = 0 # Define - bc, gxy, gwh, a = t.unsafe_chunk(4, dim=1) # (image, class), grid xy, grid wh, anchors + bc, gxy, gwh, a = t.chunk(4, 1) # (image, class), grid xy, grid wh, anchors a, (b, c) = a.long().view(-1), bc.long().T # anchors, image, class gij = (gxy - offsets).long() gi, gj = gij.T # grid indices