Properly account for non-list instances in list comparison (#148470)
Summary:
As title; this patch also removes an unused `list_compare` method.
Fixes #148179.
X-link: https://github.com/pytorch/pytorch/pull/148470
Approved by: https://github.com/anijain2305
Reviewed By: jovianjaison
Differential Revision: D70785946
fbshipit-source-id: 8725c2fa50da8067a4d411a2be0982b5ed0e2eff