explicitly provide memory format when calling to *_like operators (Redo of e3e06549)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/30004
Test Plan: Imported from OSS
Differential Revision: D18575977
Pulled By: VitalyFedyunin
fbshipit-source-id: 344e9a11c93c7e4a822f424c94fa2255592d118e