[tensorexpr] Add 'is_allocated' flag for buffers and use it to insert 'Alloc/Free' stmts (#64226)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/64226
Test Plan: Imported from OSS
Reviewed By: ZolotukhinM
Differential Revision: D30652221
Pulled By: huiguoo
fbshipit-source-id: ef9bb0e3db2c444b476e5fc23956bc34ae0f0111