tree: a221a687e0f2b42dbdf4afd1f9db6826d7020706 [path history] [tgz]
  1. doc/
  2. generic/
  3. CMakeLists.txt
  4. init.cpp
  5. README.md
  6. THNN.h
aten/src/THNN/README.md

THNN

THNN is a library that gathers nn‘s C implementations of neural network modules. It’s entirely free of Lua dependency and therefore can be used in any application that has a C FFI. Please note that it only contains quite low level functions; most users will want to use ATen, which provides a C++ wrapper around these functions.

There is also a CUDA counterpart of THNN, THCUNN.

Looking to add an implementation? Consider writing an ATen native function instead! See ../ATen/native.

Links

API

THNN is a purely functional library. It provides 2-3 functions for each module, that perform the most important operations:

  • updateOutput - applies the module to an input
  • updateGradInput - accepts gradient w.r.t. output and previous module input, and computes a gradient w.r.t. that input
  • accGradParameters - (optional, only modules with parameters) accepts gradient w.r.t. output and previous module input, and computes gradient w.r.t. the parameters

For information on argument types please check the API reference.

Developer docs