[ONNX] Convert _len based on the first dimension length (#47538)
Summary:
This PR is a bug fix.
As UT shows, for multiple-dimensional tensors, the current conversion for _len returns the total number of the tensors. But it should return the first dimension length, as pytorch _len defines.
Need `Squeeze` op at the end to ensure it outputs a scalar value.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47538
Reviewed By: malfet
Differential Revision: D24870717
Pulled By: bzinodev
fbshipit-source-id: c53c745baa6d2fb7cc1de55a19bd2eedb2ad5272