We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
diff
1 parent 5afc28e commit c818dbcCopy full SHA for c818dbc
dpctl/tests/test_tensor_diff.py
@@ -122,3 +122,22 @@ def test_diff_0d():
122
x = dpt.ones(())
123
with pytest.raises(ValueError):
124
dpt.diff(x)
125
+
126
127
+def test_diff_empty_array():
128
+ get_queue_or_skip()
129
130
+ x = dpt.ones((3, 0, 5))
131
+ res = dpt.diff(x, axis=1)
132
+ assert res.shape == x.shape
133
134
+ res = dpt.diff(x, axis=0)
135
+ assert res.shape == (2, 0, 5)
136
137
+ append = dpt.ones((3, 2, 5))
138
+ res = dpt.diff(x, axis=1, append=append)
139
+ assert res.shape == (3, 1, 5)
140
141
+ prepend = dpt.ones((3, 2, 5))
142
+ res = dpt.diff(x, axis=1, prepend=prepend)
143
0 commit comments