Rename onnx_dynamic -> dynamic (#9168)

This commit is contained in:
Glenn Jocher authored and GitHub committed 2022-08-26 14:34:28 +02:00
1 parent f2b8f3fe3a
commit 85d7ae2195
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -37,7 +37,7 @@ except ImportError:
class Detect(nn.Module):
stride = None # strides computed during build
onnx_dynamic = False # ONNX export parameter
dynamic = False # force grid reconstruction
export = False # export mode
def __init__(self, nc=80, anchors=(), ch=(), inplace=True): # detection layer
@@ -60,7 +60,7 @@ class Detect(nn.Module):
x[i] = x[i].view(bs, self.na, self.no, ny, nx).permute(0, 1, 3, 4, 2).contiguous()
if not self.training: # inference
if self.onnx_dynamic or self.grid[i].shape[2:4] != x[i].shape[2:4]:
if self.dynamic or self.grid[i].shape[2:4] != x[i].shape[2:4]:
self.grid[i], self.anchor_grid[i] = self._make_grid(nx, ny, i)
y = x[i].sigmoid()