TensorRT icon indicating copy to clipboard operation
TensorRT copied to clipboard

Which torch operator can cause nonzero problems?

Open 980202006 opened this issue 2 years ago • 2 comments

There is no torch.nonzero in my torch model, but a nonzero error is reported. Which torch operations may cause nonzero problems, or how can I find out which operators contain nonzero operations?

980202006 avatar Aug 02 '22 03:08 980202006

torch.where I guess

zhiqwang avatar Aug 02 '22 06:08 zhiqwang

I think it's better to ask in the pytorch repo.

zerollzeng avatar Aug 03 '22 01:08 zerollzeng

it has 3 scene:

  1. tensor mask op,as example:x = x[x.sum(dim=-1) > 0]
  2. torch.where(condition), as example: torch.where(x>0)
  3. torch.nonzero(x)

wugoukanle avatar Nov 07 '22 05:11 wugoukanle

Thank you!

980202006 avatar Nov 08 '22 02:11 980202006