File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
+ import pytest
18
+
17
19
import dpctl .tensor as dpt
18
20
from dpctl .tests .helper import get_queue_or_skip
19
21
@@ -49,6 +51,15 @@ def test_unary_class_str_repr():
49
51
assert kl_n in r
50
52
51
53
54
+ def test_unary_read_only_out ():
55
+ get_queue_or_skip ()
56
+ x = dpt .arange (32 , dtype = dpt .int32 )
57
+ r = dpt .empty_like (x )
58
+ r .flags ["W" ] = False
59
+ with pytest .raises (ValueError ):
60
+ unary_fn (x , out = r )
61
+
62
+
52
63
def test_binary_class_getters ():
53
64
fn = binary_fn .get_implementation_function ()
54
65
assert callable (fn )
@@ -105,3 +116,13 @@ def test_binary_class_nout():
105
116
nout = binary_fn .nout
106
117
assert isinstance (nout , int )
107
118
assert nout == 1
119
+
120
+
121
+ def test_biary_read_only_out ():
122
+ get_queue_or_skip ()
123
+ x1 = dpt .ones (32 , dtype = dpt .float32 )
124
+ x2 = dpt .ones_like (x1 )
125
+ r = dpt .empty_like (x1 )
126
+ r .flags ["W" ] = False
127
+ with pytest .raises (ValueError ):
128
+ binary_fn (x1 , x2 , out = r )
You can’t perform that action at this time.
0 commit comments