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 1414# See the License for the specific language governing permissions and
1515# limitations under the License.
1616
17+ import pytest
18+
1719import dpctl .tensor as dpt
1820from dpctl .tests .helper import get_queue_or_skip
1921
@@ -49,6 +51,15 @@ def test_unary_class_str_repr():
4951 assert kl_n in r
5052
5153
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+
5263def test_binary_class_getters ():
5364 fn = binary_fn .get_implementation_function ()
5465 assert callable (fn )
@@ -105,3 +116,13 @@ def test_binary_class_nout():
105116 nout = binary_fn .nout
106117 assert isinstance (nout , int )
107118 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