[torch.fx] Check node type before fetching .users (#80166)
Summary:
as title
currently it fails when `node` is actually a constant instead of `fx.Node`
Test Plan: existing unit tests
Differential Revision: D37389003
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80166
Approved by: https://github.com/jerryzh168