use expect instead of casting in register_c10_ops (#31401)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/31401
As title, just a mechanical change
Test Plan: Imported from OSS
Differential Revision: D19152965
Pulled By: suo
fbshipit-source-id: 6bb27df7c8f542c55110286c156358ba0936269f