ABCDEFGHIJKLMNOPQRSTUVWXYZAAAB
1
2
Python Data API Specification
(commit: 942c9538b0dba04fcc8ad4f8a53107de1416cc9a)
PyTorch v1.10 ImplementationChanges NeededRelated DiscussionLegend
3
API Specification
No
No changes needed.
4
Array Object
New API
Need to add a new function or constant.
5
OperatorsEnhancement
Need enhancement to the existing function (add new argument, etc.).
6
__lt__(x1, x2)torch.Tensor.__lt__NoEnhancement with BC
Need to change signature of the existing function. (breaking change)
7
__le__(x1, x2)torch.Tensor.__le__NoBehavior
Need to change behavior of the existing function. (breaking change)
8
__gt__(x1, x2)torch.Tensor.__gt__NoN/A
The detailed specification is not determined yet in the Data API.
9
__ge__(x1, x2)torch.Tensor.__ge__No
10
__eq__(x1, x2)torch.Tensor.__eq__No
11
__ne__(x1, x2)torch.Tensor.__ne__No
12
__pos__(x)torch.Tensor.__pos__No
13
__neg__(x)torch.Tensor.__neg__No
14
__add__(x1, x2)torch.Tensor.__add__No
15
__sub__(x1, x2)torch.Tensor.__sub__No
16
__mul__(x1, x2)torch.Tensor.__mul__No
17
__truediv__(x1, x2)torch.Tensor.__truediv__No
18
__floordiv__(x1, x2)torch.Tensor.__floordiv__BehaviorMust be changed to take floorhttps://github.com/pytorch/pytorch/issues/43874
19
__mod__(x1, x2)torch.Tensor.__mod__No
20
__pow__(x1, x2)torch.Tensor.__pow__No
21
__matmul__(x1, x2)torch.Tensor.__matmul__No
22
__invert__(x)torch.Tensor.__invert__No
23
__and__(x1, x2)torch.Tensor.__and__No
24
__or__(x1, x2)torch.Tensor.__or__No
25
__xor__(x1, x2)torch.Tensor.__xor__No
26
__lshift__(x1, x2)torch.Tensor.__lshift__No
27
__rshift__(x1, x2)torch.Tensor.__rshift__No
28
In-place Operators
29
__iadd__torch.Tensor.__iadd__No
30
__isub__torch.Tensor.__isub__No
31
__imul__torch.Tensor.__imul__No
32
__itruediv__torch.Tensor.__itruediv__No
33
__ifloordiv__torch.Tensor.__ifloordiv__BehaviorMust be changed to take floorhttps://github.com/pytorch/pytorch/issues/43874
34
__ipow__torch.Tensor.__ipow__No
35
__imatmul__(not implemented)New API
36
__imod__(not implemented)New API
37
__iand__torch.Tensor.__iand__No
38
__ior__torch.Tensor.__ior__No
39
__ixor__torch.Tensor.__ixor__No
40
__ilshift__torch.Tensor.__ilshift__No
41
__irshift__torch.Tensor.__irshift__No
42
Reflected Operators
43
__radd__torch.Tensor.__radd__No
44
__rsub__torch.Tensor.__rsub__No
45
__rmul__torch.Tensor.__rmul__No
46
__rtruediv__torch.Tensor.__rtruediv__No
47
__rfloordiv__torch.Tensor.__rfloordiv__BehaviorMust be changed to take floorhttps://github.com/pytorch/pytorch/issues/43874
48
__rpow__torch.Tensor.__rpow__No
49
__rmatmul__
50
__rmod__torch.Tensor.__rmod__No
51
__rand__(not implemented)New API
52
__ror__(not implemented)New API
53
__rxor__(not implemented)New API
54
__rlshift__(not implemented)New API
55
__rrshift__(not implemented)New API
56
Attributes
57
dtypetorch.Tensor.dtypeNo
58
devicetorch.Tensor.deviceNo
59
ndimtorch.Tensor.ndimNo
60
shape -> _Tuple[Optional[int], ...]torch.Tensor.shapeNo
61
size -> _Tuple[Optional[int], ...]torch.Tensor.sizeBehavior
- PyTorch returns the shape, but number of elements must be returned.
- Currently implemented as method, but must be changed to property method for attribute access
Needs discussion
62
Ttorch.Tensor.TNo
63
mTNew API(..., M, N) -> (..., N, M)
64
Methods
65
__abs__(x, /)torch.Tensor.__abs__No
66
__add__(x1, x2, /)torch.Tensor.__add__No
67
__and__(x1, x2, /)torch.Tensor.__and__No
68
__array_namespace__(self, /, *, api_version=None)(not implemented)New API
69
__bool__(x, /)torch.Tensor.__bool__No
70
__dlpack__(/, *, stream=None)torch.utils.dlpack.to_dlpack(tensor) → PyCapsuleNew API
71
__dlpack_device__()(not implemented)New API
72
__eq__(x1, x2, /)torch.Tensor.__eq__No
73
__float__(x, /)torch.Tensor.__float__No
74
__floordiv__(x1, x2, /)torch.Tensor.__floordiv__BehaviorMust be changed to take floorhttps://github.com/pytorch/pytorch/issues/43874
75
__ge__(x1, x2, /)torch.Tensor.__ge__No
76
__getitem__(x, key, /)torch.Tensor.__getitem__No
77
__gt__(x1, x2, /)torch.Tensor.__gt__No
78
__index__(self, /)New API
79
__int__(x, /)torch.Tensor.__int__No
80
__invert__(x, /)torch.Tensor.__invert__No
81
__le__(x1, x2, /)torch.Tensor.__le__No
82
__len__(x, /)torch.Tensor.__len__No
83
__lshift__(x1, x2, /)torch.Tensor.__lshift__No
84
__lt__(x1, x2, /)torch.Tensor.__lt__No
85
__matmul__(x1, x2, /)torch.Tensor.__matmul__No
86
__mod__(x1, x2, /)torch.Tensor.__mod__No
87
__mul__(x1, x2, /)torch.Tensor.__mul__No
88
__ne__(x1, x2, /)torch.Tensor.__ne__No
89
__neg__(x, /)torch.Tensor.__neg__No
90
__or__(x1, x2, /)torch.Tensor.__or__No
91
__pos__(x, /)torch.Tensor.__pos__No
92
__pow__(x1, x2, /)torch.Tensor.__pow__No
93
__rshift__(x1, x2, /)torch.Tensor.__rshift__No
94
__setitem__(x, key, value, /)torch.Tensor.__setitem__No
95
__sub__(x1, x2, /)torch.Tensor.__sub__No
96
__truediv__(x1, x2, /)torch.Tensor.__truediv__No
97
__xor__(x1, x2, /)torch.Tensor.__xor__No
98
to_device(self, device, /, *, stream=None)New API
99
Data Types
100
booltorch.boolNo