Skip to content

Instantly share code, notes, and snippets.

View freesouls's full-sized avatar

Binbin Xu(徐彬彬) freesouls

View GitHub Profile
@freesouls
freesouls / faux_cudnn.py
Created September 29, 2017 11:45 — forked from JonathanRaiman/faux_cudnn.py
Convert CUDNN LSTM to Dynamic RNN
"""
Little script demonstration how to run cudnn rnns
without cudnn using dynamic rnn with the same weights
(e.g. train on cudnn, use with dynamic rnn on cpu).
Note: this will run slower than cudnn on a gpu (see below).
Tested on Titan X Pascal:
With cudnn 3.5s vs. with dynamic_rnn 8s to run through 79 batches
with batch size 128.
Network: input size: 127, 2 layer bidirectional LSTM with num_units 200.
name: "CIFAR10_resnet"
layer {
name: "data"
type: "Data"
top: "data"
top: "label"
include {
phase: TRAIN
}
transform_param {