Skip to content

Commit

Permalink
fix for symbol api
Browse files Browse the repository at this point in the history
  • Loading branch information
HaydenFaulkner committed Nov 20, 2019
1 parent aaa7dca commit a287491
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions models/definitions/darknet/h_darknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ def hybrid_forward(self, F, x): # b,t,c,w,h

x = TimeDistributed(self.features[0])(x) # b,t,c,w,h

x = mx.nd.swapaxes(x, 1, 2) # b,c,t,w,h
x = mx.nd.expand_dims(x, axis=2) # b,c,1,t,w,h
x = mx.nd.reshape(x, shape=(0, 0, -1, 3, 0, 0)) # correctly ordered # b,c,t',win=3,w,h
x = mx.nd.swapaxes(x, 1, 2) # b,t',c,win=3,w,h
x = F.swapaxes(x, 1, 2) # b,c,t,w,h
x = F.expand_dims(x, axis=2) # b,c,1,t,w,h
x = F.reshape(x, shape=(0, 0, -1, 3, 0, 0)) # correctly ordered # b,c,t',win=3,w,h
x = F.swapaxes(x, 1, 2) # b,t',c,win=3,w,h

if self.type == 'max':
x = F.max(x, axis=-3)
Expand All @@ -207,10 +207,10 @@ def hybrid_forward(self, F, x): # b,t,c,w,h
return a, b, c

x = TimeDistributed(self.features[1:3])(x) # b,t,c,w,h
x = mx.nd.swapaxes(x, 1, 2) # b,c,t,w,h
x = mx.nd.expand_dims(x, axis=2) # b,c,1,t,w,h
x = mx.nd.reshape(x, shape=(0, 0, -1, 3, 0, 0)) # correctly ordered # b,c,t',win=3,w,h
x = mx.nd.swapaxes(x, 1, 2) # b,t',c,win=3,w,h
x = F.swapaxes(x, 1, 2) # b,c,t,w,h
x = F.expand_dims(x, axis=2) # b,c,1,t,w,h
x = F.reshape(x, shape=(0, 0, -1, 3, 0, 0)) # correctly ordered # b,c,t',win=3,w,h
x = F.swapaxes(x, 1, 2) # b,t',c,win=3,w,h

if self.type == 'max':
x = F.max(x, axis=-3)
Expand All @@ -226,10 +226,10 @@ def hybrid_forward(self, F, x): # b,t,c,w,h
return a, b, c

x = TimeDistributed(self.features[3:6])(x)
x = mx.nd.swapaxes(x, 1, 2) # b,c,t,w,h
x = mx.nd.expand_dims(x, axis=2) # b,c,1,t,w,h
x = mx.nd.reshape(x, shape=(0, 0, -1, 3, 0, 0)) # correctly ordered # b,c,t',win=3,w,h
x = mx.nd.swapaxes(x, 1, 2) # b,t',c,win=3,w,h
x = F.swapaxes(x, 1, 2) # b,c,t,w,h
x = F.expand_dims(x, axis=2) # b,c,1,t,w,h
x = F.reshape(x, shape=(0, 0, -1, 3, 0, 0)) # correctly ordered # b,c,t',win=3,w,h
x = F.swapaxes(x, 1, 2) # b,t',c,win=3,w,h

if self.type == 'max':
x = F.max(x, axis=-3)
Expand All @@ -245,10 +245,10 @@ def hybrid_forward(self, F, x): # b,t,c,w,h
return a, b, c

x = TimeDistributed(self.features[6:15])(x)
x = mx.nd.swapaxes(x, 1, 2) # b,c,t,w,h
x = mx.nd.expand_dims(x, axis=2) # b,c,1,t,w,h
x = mx.nd.reshape(x, shape=(0, 0, -1, 3, 0, 0)) # correctly ordered # b,c,t',win=3,w,h
x = mx.nd.swapaxes(x, 1, 2) # b,t',c,win=3,w,h
x = F.swapaxes(x, 1, 2) # b,c,t,w,h
x = F.expand_dims(x, axis=2) # b,c,1,t,w,h
x = F.reshape(x, shape=(0, 0, -1, 3, 0, 0)) # correctly ordered # b,c,t',win=3,w,h
x = F.swapaxes(x, 1, 2) # b,t',c,win=3,w,h

if self.type == 'max':
x = F.max(x, axis=-3)
Expand Down

0 comments on commit a287491

Please sign in to comment.