Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] Make legacy type storage warning point to the caller #113601

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions torch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ def _check_tensor_all(cond, message=None): # noqa: F811
class ByteStorage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1178,7 +1178,7 @@ def _dtype(self):
class DoubleStorage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1188,7 +1188,7 @@ def _dtype(self):
class FloatStorage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1198,7 +1198,7 @@ def _dtype(self):
class HalfStorage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1208,7 +1208,7 @@ def _dtype(self):
class LongStorage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1218,7 +1218,7 @@ def _dtype(self):
class IntStorage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1228,7 +1228,7 @@ def _dtype(self):
class ShortStorage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1238,7 +1238,7 @@ def _dtype(self):
class CharStorage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1248,7 +1248,7 @@ def _dtype(self):
class BoolStorage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1258,7 +1258,7 @@ def _dtype(self):
class BFloat16Storage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1268,7 +1268,7 @@ def _dtype(self):
class ComplexDoubleStorage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1278,7 +1278,7 @@ def _dtype(self):
class ComplexFloatStorage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1288,7 +1288,7 @@ def _dtype(self):
class QUInt8Storage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1298,7 +1298,7 @@ def _dtype(self):
class QInt8Storage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1308,7 +1308,7 @@ def _dtype(self):
class QInt32Storage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1318,7 +1318,7 @@ def _dtype(self):
class QUInt4x2Storage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand All @@ -1328,7 +1328,7 @@ def _dtype(self):
class QUInt2x4Storage(_LegacyStorage):
@classproperty
def dtype(self):
_warn_typed_storage_removal()
_warn_typed_storage_removal(stacklevel=3)
return self._dtype

@classproperty
Expand Down
Loading