Skip to content

Learn how to create a pooling operation from scratch using Pytorch (python) or building your own C++ extension.

License

Notifications You must be signed in to change notification settings

ChristoferNal/custom-pooling-operation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

custom-pooling-operation

Learn how to create a pooling operation from scratch using Pytorch (python) or building your own C++ extension.

The tutorial in a relative link includes:

  • Implementation of max pool using the python API of pytorch.
  • Implementation of max pool using the C++ API of pytorch and instructions on how to build a python binding.
  • Performance comparison of the custom max pool in python, the C++ extension and the native pytorch max pool operation.

Setup

Install the both the python and the C++ distribution of pytorch. Instructions for the C++ distribution can be found here https://pytorch.org/cppdocs/installing.html In order to build the custom model run the following commands from your pytorch environment:

  • cd /cpp
  • python setup.py install

You should get something like this:

Installed ~/anaconda2/envs/torch/lib/python3.7/site-packages/pooling_cpp-0.0.0-py3.7-linux-x86_64.egg Processing dependencies for pooling-cpp==0.0.0 Finished processing dependencies for pooling-cpp==0.0.0

About

Learn how to create a pooling operation from scratch using Pytorch (python) or building your own C++ extension.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published