updated dimshuffles to work on gpu