Prune head_size last layers of a nn_module in order to replace them by your own head, or in order to use the pruned module as a sequential embedding module.
nn_prune_head(x, head_size)
Arguments
x: nn_network to prune
head_size: number of nn_layers to prune
Returns
a nn_sequential network with the top nn_layer removed