[jit] Handle output tensor being passed in as inputs to TensorExprDynamicGroup (#69478)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69478
This diff handles the case when output tensors are being passed in as
inputs to TensorExprDynamicGroup op.
This is in preparation to support out-variant optimizations in Static Runtime.
ghstack-source-id: 146107007
Test Plan: buck test mode/dev-nosan //caffe2/test/cpp/jit:jit
Reviewed By: eellison
Differential Revision: D32823889
fbshipit-source-id: ff18e17fcd09953e55c8da6b892e60756521c2fc