canonicalize_ops pass bugfix: copy metadata for new output (#23809)
Summary:
Without metadata(datatype) for the new output, exporter won't be able to perform implicit scalar datatype casting. This PR covers a large portion of this common issue seen in many exported models, e.g. https://github.com/pytorch/pytorch/issues/23724
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23809
Reviewed By: ezyang
Differential Revision: D16707640
Pulled By: bddppq
fbshipit-source-id: 3de985c6b580b9c9ebaec08085c7443bd8d9c7f8