Fixes cat backward formula to return correct gradient values for R -> C case (#51681)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/51681
Fixes https://github.com/pytorch/pytorch/issues/51627
Test Plan: Imported from OSS
Reviewed By: gchanan
Differential Revision: D26238748
Pulled By: anjali411
fbshipit-source-id: 1dc47f8ddddbf3f2c176f21e5dcee917f84f4c93