We haven’t exposed this at the Python level. What’s missing is that we need to write  Python wrapper for this, similar to:

  
      github.com
  
  
    torch/nn/blob/master/SpatialFractionalMaxPooling.lua 32
local SpatialFractionalMaxPooling, parent =
   torch.class('nn.SpatialFractionalMaxPooling', 'nn.Module')

-- Usage:
-- nn.SpatialFractionalMaxPooling(poolSizeW, poolSizeH, outW, outH)
--   the output should be the exact size (outH x outW)
-- nn.SpatialFractionalMaxPooling(poolSizeW, poolSizeH, ratioW, ratioH)
--   the output should be the size (floor(inH x ratioH) x floor(inW x ratioW))
--   ratios are numbers between (0, 1) exclusive
function SpatialFractionalMaxPooling:__init(poolSizeW, poolSizeH, arg1, arg2)
   parent.__init(self)
   assert(poolSizeW >= 2)
   assert(poolSizeH >= 2)

   -- Pool size (how wide the pooling for each output unit is)
   self.poolSizeW = poolSizeW
   self.poolSizeH = poolSizeH

   -- Random samples are drawn for all
   -- batch * plane * (height, width; i.e., 2) points. This determines


  This file has been truncated. show original

  
  
    
    
  
  



  
      github.com
  
  
    pytorch/pytorch/blob/master/torch/nn/modules/pooling.py 36
import torch
from torch.autograd import Variable

from .module import Module
from .utils import _single, _pair, _triple
from .. import functional as F


class MaxPool1d(Module):
    r"""Applies a 1D max pooling over an input signal composed of several input
    planes.

    In the simplest case, the output value of the layer with input size :math:`(N, C, L)`
    and output :math:`(N, C, L_{out})` can be precisely described as:

    .. math::

        \begin{array}{ll}
        out(N_i, C_j, k)  = \max_{{m}=0}^{{kernel\_size}-1} input(N_i, C_j, stride * k + m)
        \end{array}


  This file has been truncated. show original

  
  
    
    
  
  


It’s a low priority task, but we’ll eventually expose it.
If you want to give a hand at implementing the wrapper, we’d love a contribution