From cac78dd7af7ca0a8fdf9738c78fda9a1bce8964d Mon Sep 17 00:00:00 2001 From: Charlie West-Taylor Date: Wed, 23 Nov 2022 19:51:50 +0000 Subject: [PATCH] Mark IPU device as not supports_as_strided (#89130) Currently causes issues in calls to `.to`. Pull Request resolved: https://github.com/pytorch/pytorch/pull/89130 Approved by: https://github.com/albanD --- c10/core/Device.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c10/core/Device.h b/c10/core/Device.h index cea7cfec119e92b..d53ab38ff9cb951 100644 --- a/c10/core/Device.h +++ b/c10/core/Device.h @@ -148,7 +148,8 @@ struct C10_API Device final { /// Return true if the device supports arbirtary strides. bool supports_as_strided() const noexcept { - return type_ != DeviceType::XLA && type_ != DeviceType::Lazy; + return type_ != DeviceType::IPU && type_ != DeviceType::XLA && + type_ != DeviceType::Lazy; } /// Same string as returned from operator<<.