pyanomaly/networks/meta/pcn_parts/prednet.py
def batch_flatten(x):
    '''
    equal to the `batch_flatten` in keras.
    x is a Variable in pytorch
    '''
    shape = [*x.size()]
    dim = np.prod(shape[1:])
    dim = int(dim)      # 不加这步的话, dim是<class 'numpy.int64'>类型, 不能在view中用. 加上这步转成<class 'int'>类型.
    return x.view(-1, dim)

    equal to the `batch_flatten` in keras.
    x is a Variable in pytorch
    
equal to the `batch_flatten` in keras.
x is a Variable in pytorch
equal to the ` batch_flatten ` in keras . x is a Variable in pytorch
def batch_flatten(x):
    shape = [*x.size()]
    dim = np.prod(shape[1:])
    dim = int(dim)      
    return x.view(-1, dim)
def batch_flatten ( x ) : shape = [ * x . size ( ) ] dim = np . prod ( shape [ 1 : ] ) dim = int ( dim ) return x . view ( - 1 , dim )
equal to the `batch_flatten` in keras.
equal to the ` batch_flatten ` in keras .
'''
    equal to the `batch_flatten` in keras.
    x is a Variable in pytorch
    ''' # 不加这步的话, dim是<class 'numpy.int64'>类型, 不能在view中用. 加上这步转成<class 'int'>类型.

x