Skip to content

Instantly share code, notes, and snippets.

@albanD
Created September 21, 2015 09:45
Show Gist options
  • Save albanD/26d4d14484808b144877 to your computer and use it in GitHub Desktop.
Save albanD/26d4d14484808b144877 to your computer and use it in GitHub Desktop.
function networks.convs_noutput(convs, input_size)
input_size = input_size or networks.base_input_size
-- Get the number of channels for conv that are multiscale or not
local nbr_input_channels = convs[1]:get(1).nInputPlane or
convs[1]:get(1):get(1).nInputPlane
local output = torch.Tensor(1, nbr_input_channels, input_size, input_size)
for _, conv in ipairs(convs) do
output = conv:forward(output)
end
return output:nElement(), output:size(3)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment