How do I use layers from here

  
      
      GitHub
  
  
    

pytorch/pytorch

Tensors and Dynamic neural networks in Python  with strong GPU acceleration - pytorch/pytorch


  
  
    
    
  
  


in my model code?
For example how do I incorporate this layer in a standard pytorch model?

  
      github.com
  
  
    pytorch/pytorch/blob/master/caffe2/python/layers/random_fourier_features.py#L12 3

from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals


from caffe2.python import schema
from caffe2.python.layers.layers import ModelLayer


import numpy as np




class RandomFourierFeatures(ModelLayer):
"""
Implementation of random fourier feature map for feature processing.


Applies sqrt(2 / output_dims) * cos(wx+b), where:
    output_dims is the output feature dimensions, and
    wx + b applies FC using randomized, fixed weight and bias parameters


For more information, see the original paper:
    https://people.eecs.berkeley.edu/~brecht/papers/07.rah.rec.nips.pdf