UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\TensorShape.cpp:3191.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
时间: 2023-07-23 13:14:09 浏览: 307
这是一个警告信息,提示在将来的一个版本中,在使用 torch.meshgrid 函数时需要传递索引参数。这个警告是发生在路径为 c:\\actions-runner\\_work\\pytorch\\pytorch\\builder\\windows\\pytorch\\aten\\src\\aten\\native\\tensorshape.cpp:2228 的代码位置。这段警告信息在运行 _vf.meshgrid(tensors, **kwargs) 时触发。
相关问题
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]来解除警告。
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函数,避免了警告的出现。