nncf icon indicating copy to clipboard operation
nncf copied to clipboard

Add a workaround for torch<1.11.0 bug with tensor indexing

Open vshampor opened this issue 4 years ago • 2 comments

Changes

For torch < 1.11.0, additionally wrap tensor indices for torch.Tensor in a tuple so that indexing a tensor using TracedTensor indices has correct behaviour.

Reason for changes

Fixes incorrect behaviour of NNCF for clients with torch < 1.11.0.

Related tickets

82065

Tests

TBA

vshampor avatar Mar 31 '22 10:03 vshampor

upstream patch was applied torch==1.11.0.

vinnamkim avatar Apr 18 '22 05:04 vinnamkim

For torch<1.11.0, this PR patches __getitem__ operator as same as https://github.com/pytorch/pytorch/issues/52721#issuecomment-804773009.

vinnamkim avatar Apr 18 '22 05:04 vinnamkim

@vshampor, is it actual since we bumped torch version to 1.12?

ljaljushkin avatar Nov 22 '22 08:11 ljaljushkin

@vshampor, is it actual since we bumped torch version to 1.12?

Not really.

vshampor avatar Nov 22 '22 09:11 vshampor