In utils.py:
def concat_elu(x):""" like concatenated ReLU (http://arxiv.org/abs/1603.05201), but then with ELU """# Pytorch orderingaxis = len(x.size()) - 3return F.elu(torch.cat([x, -x], dim=axis))
How does PyTorch differ from Tensorflow in this regard? Why is this 3 instead of 1?
In pytorch, 4 dimensional tensor are ordered as batch_size x num_channels x height x width, whereas in tensorflow it's batch_size x height x width x channels
In utils.py:
def concat_elu(x):
""" like concatenated ReLU (http://arxiv.org/abs/1603.05201), but then with ELU """
# Pytorch ordering
axis = len(x.size()) - 3
return F.elu(torch.cat([x, -x], dim=axis))
How does PyTorch differ from Tensorflow in this regard? Why is this 3 instead of 1?