[w indexingutils.h:30] warning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead. (function expandtensors)
时间: 2023-05-04 18:01:40 浏览: 77
这是一个警告信息,意思是在使用索引时使用了torch.uint8这个数据类型已经不推荐使用了,建议使用torch.bool代替。警告信息出现在索引工具文件(indexingutils.h)的第30行,出现的函数是expandtensors。
相关问题
UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argume
UserWarning: torch.meshgrid: 在即将发布的版本中,将需要传递索引参数。这个警告是由于在调用torch.meshgrid函数时没有传递索引参数引发的。您可以通过修改代码中的一行来解决这个问题。在functional.py文件的第568行,将return _VF.meshgrid(tensors, **kwargs)改为return _VF.meshgrid(tensors, **kwargs,indexing='ij')。这样就会传递索引参数'ij'给torch.meshgrid函数,避免了警告的出现。
UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument.
UserWarning: torch.meshgrid:在即将发布的版本中,需要传递索引参数。这个警告是因为在下一个版本中,torch.meshgrid函数将要求传递索引参数。解决方法是在函数调用时使用return _VF.meshgrid(tensors, **kwargs, indexing='ij')来指定索引参数,并且添加# type: ignore[attr-defined]来解除警告。