change temp assignment to var

Changed lines with `temp := &Dense{}` to `var temp Dense`