forked from szagoruyko/imagine-nn
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ffi.lua
29 lines (24 loc) · 1.48 KB
/
ffi.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
local ffi = require 'ffi'
ffi.cdef[[
void SpatialMaxPooling_updateOutput(struct THCState* state, THCudaTensor* input,
THCudaTensor* output, THCudaTensor* indices,
int kW, int kH, int dW, int dH);
void SpatialMaxPooling_updateGradInput(struct THCState* state, THCudaTensor* input,
THCudaTensor* gradInput, THCudaTensor* gradOutput, THCudaTensor* indices,
int kW, int kH, int dW, int dH);
void SpatialAveragePooling_updateOutput(struct THCState* state, THCudaTensor* input,
THCudaTensor* output, int kW, int kH, int dW, int dH);
void SpatialAveragePooling_updateGradInput(struct THCState* state, THCudaTensor* input,
THCudaTensor* gradInput, THCudaTensor* gradOutput, int kW, int kH, int dW, int dH);
void SpatialStochasticPooling_updateOutput(THCState* state, THCudaTensor* input,
THCudaTensor* output, THCudaTensor* indices, int kW, int kH, int dW, int dH, bool train);
void SpatialStochasticPooling_updateGradInput(THCState* state, THCudaTensor* input,
THCudaTensor* gradInput, THCudaTensor* gradOutput, THCudaTensor* indices, int kW, int kH, int dW, int dH);
void LRNforward(struct THCState* state, THCudaTensor* input,
THCudaTensor* output, THCudaTensor* scale,
int local_size, float alpha, float beta, float k);
void LRNbackward(struct THCState* state, THCudaTensor* input,
THCudaTensor* output, THCudaTensor* gradOutput, THCudaTensor* gradInput, THCudaTensor* scale,
int local_size, float alpha, float beta, float k);
]]
inn.C = ffi.load(package.searchpath('libinn', package.cpath))