5 from __future__
import absolute_import
6 from __future__
import division
7 from __future__
import print_function
8 from __future__
import unicode_literals
11 def max_pool(model, blob_in, blob_out, use_cudnn=False, order="NCHW", **kwargs):
14 kwargs[
'engine'] =
'CUDNN' 15 return model.net.MaxPool(blob_in, blob_out, order=order, **kwargs)
18 def average_pool(model, blob_in, blob_out, use_cudnn=False, order="NCHW",
22 kwargs[
'engine'] =
'CUDNN' 23 return model.net.AveragePool(
31 def max_pool_with_index(model, blob_in, blob_out, order="NCHW", **kwargs):
32 """Max pooling with an explicit index of max position""" 33 return model.net.MaxPoolWithIndex(
35 [blob_out, blob_out +
"_index"],