Fix for codes not using pinned memory (#7001)
Fix for codes not using pinned memory (#7001)

* Fix for codes not using pinned memory

* Fix from review

* Fix indentation

Guneet-Dhillon/mxnet,Guneet-Dhillon/mxnet,Guneet-Dhillon/mxnet,Guneet-Dhillon/mxnet,Guneet-Dhillon/mxnet,Guneet-Dhillon/mxnet,Guneet-Dhillon/mxnet,Guneet-Dhillon/mxnet,Guneet-Dhillon/mxnet