<reponame>haophancs/TREQS<gh_stars>100-1000
'''
@author <NAME>
Please contact <EMAIL>
'''
import math

import torch


def maxout(input_, pool_size):
    '''
    maxout activation
    '''
    input_size = list(input_.size())
    assert input_.size(-1) % pool_size == 0

    out_size = input_.size(-1) // pool_size
    input_size[-1] = out_size
    input_size.append(pool_size)

    return input_.view(*input_size).max(-1)

'''
@author <NAME>
Please contact <EMAIL>
'''
import math

import torch


def maxout(input_, pool_size):
    '''
    maxout activation
    '''
    input_size = list(input_.size())
    assert input_.size(-1) % pool_size == 0

    out_size = input_.size(-1) // pool_size
    input_size[-1] = out_size
    input_size.append(pool_size)

    return input_.view(*input_size).max(-1)
@author <NAME> Please contact <EMAIL> maxout activation