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