Last active
October 3, 2018 16:47
-
-
Save infinityfuture/ea37d68fd3476c55a0b7b92d747d9e7b to your computer and use it in GitHub Desktop.
Pytorch Global Max Pooling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def global_max_pooling(tensor, dim, topk): | |
"""Global max pooling""" | |
ret, _ = torch.topk(tensor, topk, dim) | |
return ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment