Rename onnx_dynamic -> dynamic (#9168)

pull/9093/head^2
Glenn Jocher 2022-08-26 14:34:28 +02:00 committed by GitHub
parent f2b8f3fe3a
commit 85d7ae2195
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -489,7 +489,7 @@ def run(
for k, m in model.named_modules():
if isinstance(m, Detect):
m.inplace = inplace
m.onnx_dynamic = dynamic
m.dynamic = dynamic
m.export = True
for _ in range(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()