Add `dict()` constructor (#51934)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/51934
Test Plan: Imported from OSS
Reviewed By: pbelevich
Differential Revision: D26418199
Pulled By: ansley
fbshipit-source-id: 524f6d9d29ee1fa1b7c5e80ada82e577f47089dc