optimizations to dnn