Skip to content

Template for CUDA / C++ extension writing with PyTorch

License

Notifications You must be signed in to change notification settings

frgfm/torch-cuda-template

Repository files navigation

torch-cuda-template

License Codacy BadgeBuild Status codecov

Template for CUDA / C++ extension writing with PyTorch

Table of Contents

Getting started

Prerequisites

  • Python 3.6 (or more recent)
  • pip

Installation

You can install the package using the default method:

pip install -e . --upgrade

which will build the CUDA extension and bind it with your python module.

Usage

This python package can be used like any other:

import torch
import cuda_ext.nn as nn

my_module = nn.DSigmoid()

with torch.no_grad():
	out = my_module(torch.rand(2, 3, 32, 32).cuda())

Contributing

Please refer to CONTRIBUTING if you wish to contribute to this project.

Credits

The content of this repo was brought together by the repo owner but highly benefited from the following resources:

License

Distributed under the MIT License. See LICENSE for more information.

About

Template for CUDA / C++ extension writing with PyTorch

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published