[tensorexpr] Fix isNLC segfault (#72786)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/72786
Test Plan: Imported from OSS
Reviewed By: H-Huang
Differential Revision: D34204523
Pulled By: IvanKobzarev
fbshipit-source-id: 9a0f2ce0a1921e261932029c3ebd842330fdf528
(cherry picked from commit b8326064f61b27695c62c08e5a393364619e1a26)