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