Skip to content

Instantly share code, notes, and snippets.

@arunm8489
Last active June 3, 2020 15:29
Show Gist options
  • Save arunm8489/0ed1b22dc294b73842dac5ad1405ca93 to your computer and use it in GitHub Desktop.
Save arunm8489/0ed1b22dc294b73842dac5ad1405ca93 to your computer and use it in GitHub Desktop.
if module_type == "convolutional" or module_type == "upsample":
x = self.module_list[i](x)
outputs[i] = x
elif module_type == "route":
layers = module["layers"]
layers = [int(a) for a in layers]
if len(layers) == 1:
x = outputs[layers[0]]
if len(layers) > 1:
map1 = outputs[layers[0]]
map2 = outputs[layers[1]]
x = torch.cat((map1,map2),1)
outputs[i] = x
elif module_type == "shortcut":
from_ = int(module["from"])
# just adding outputs for residual network
x = outputs[i-1] + outputs[i+from_]
outputs[i] = x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment