[PyTorch] Change MaybeOwned tests to use intrusive_ptr and Tensor (#55684)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/55684
Upcoming changes to `MaybeOwned<T>` will require that T is
one of these two types and will have custom code for both.
This diff updates the tests to continue to build under these new
requirements; it is being sent separately to demonstrate that the
tests continue to work on the current implementation.
ghstack-source-id: 126405918
Test Plan: CI will run the rewritten tests.
Reviewed By: bhosmer
Differential Revision: D27630289
fbshipit-source-id: e38097d9ca04f3337cfa543ebcc8fb5d6916fcf3