@@ -42,13 +42,11 @@ def call_transpose(self):
42
42
43
43
x_c = x_transposed1 .contiguous ()
44
44
self .assertTrue (np .allclose (x_c .numpy (), x_np_transposed1 ))
45
- self .assertFalse (x_c ._is_shared_buffer_with (x_transposed1 ))
46
45
47
46
x_transposed2 = paddle .transpose (x_transposed1 , perm = [2 , 0 , 1 ])
48
47
x_np_transposed2 = x_np_transposed1 .transpose (2 , 0 , 1 )
49
48
self .assertTrue (np .allclose (x_transposed2 .numpy (), x_np_transposed2 ))
50
49
self .assertFalse (x_transposed2 .is_contiguous ())
51
- self .assertTrue (x ._is_shared_buffer_with (x_transposed2 ))
52
50
53
51
y = x_transposed2 + 2
54
52
y_np = x_np_transposed2 + 2
@@ -96,11 +94,6 @@ def call_diagonal(self):
96
94
self .assertTrue (np .allclose (out3_c .numpy (), np_out3 ))
97
95
self .assertTrue (np .allclose (out4_c .numpy (), np_out4 ))
98
96
99
- self .assertFalse (out_c ._is_shared_buffer_with (out ))
100
- self .assertFalse (out2_c ._is_shared_buffer_with (out2 ))
101
- self .assertFalse (out3_c ._is_shared_buffer_with (out3 ))
102
- self .assertFalse (out4_c ._is_shared_buffer_with (out4 ))
103
-
104
97
def call_slice (self ):
105
98
x_np = np .random .random (size = [10 , 10 , 10 , 20 ]).astype ('float32' )
106
99
x = paddle .to_tensor (x_np )
@@ -141,8 +134,6 @@ def call_strided_slice(self):
141
134
142
135
self .assertTrue (np .allclose (out_c .numpy (), np_out ))
143
136
144
- self .assertFalse (out_c ._is_shared_buffer_with (out ))
145
-
146
137
def call_index_select (self ):
147
138
x_np = np .random .random (size = [10 , 10 , 10 , 20 ]).astype ('float32' )
148
139
x = paddle .to_tensor (x_np )
@@ -161,8 +152,6 @@ def call_index_select(self):
161
152
162
153
self .assertTrue (np .allclose (out_c .numpy (), np_out ))
163
154
164
- self .assertFalse (out_c ._is_shared_buffer_with (out ))
165
-
166
155
def call_reshape (self ):
167
156
x_np = np .random .random (size = [10 , 10 , 10 , 20 ]).astype ('float32' )
168
157
x = paddle .to_tensor (x_np )
@@ -201,8 +190,6 @@ def call_real(self):
201
190
202
191
self .assertTrue (np .allclose (out_c .numpy (), np_out ))
203
192
204
- self .assertFalse (out_c ._is_shared_buffer_with (out ))
205
-
206
193
def call_imag (self ):
207
194
x_np = np .random .random (size = [10 , 10 , 10 , 20 ]).astype ('complex128' )
208
195
x = paddle .to_tensor (x_np )
@@ -221,8 +208,6 @@ def call_imag(self):
221
208
222
209
self .assertTrue (np .allclose (out_c .numpy (), np_out ))
223
210
224
- self .assertFalse (out_c ._is_shared_buffer_with (out ))
225
-
226
211
def call_as_real (self ):
227
212
x_np = np .random .random (size = [10 , 10 , 10 , 20 ]).astype ('complex128' )
228
213
x = paddle .to_tensor (x_np )
@@ -351,10 +336,6 @@ def call_split(self):
351
336
self .assertTrue (np .allclose (out1_c .numpy (), np_out1 ))
352
337
self .assertTrue (np .allclose (out2_c .numpy (), np_out2 ))
353
338
354
- self .assertFalse (out0_c ._is_shared_buffer_with (out0 ))
355
- self .assertFalse (out1_c ._is_shared_buffer_with (out1 ))
356
- self .assertFalse (out2_c ._is_shared_buffer_with (out2 ))
357
-
358
339
def call_split2 (self ):
359
340
x_np = np .random .random (size = [3 , 9 , 5 ]).astype ('float32' )
360
341
x = paddle .to_tensor (x_np )
@@ -386,10 +367,6 @@ def call_split2(self):
386
367
self .assertTrue (np .allclose (out1_c .numpy (), np_out1 ))
387
368
self .assertTrue (np .allclose (out2_c .numpy (), np_out2 ))
388
369
389
- self .assertFalse (out0_c ._is_shared_buffer_with (out0 ))
390
- self .assertFalse (out1_c ._is_shared_buffer_with (out1 ))
391
- self .assertFalse (out2_c ._is_shared_buffer_with (out2 ))
392
-
393
370
def call_split3 (self ):
394
371
x_np = np .random .random (size = [9 , 3 , 5 ]).astype ('float32' )
395
372
x = paddle .to_tensor (x_np )
@@ -485,10 +462,6 @@ def call_chunk(self):
485
462
self .assertTrue (np .allclose (out1_c .numpy (), np_out1 ))
486
463
self .assertTrue (np .allclose (out2_c .numpy (), np_out2 ))
487
464
488
- self .assertFalse (out0_c ._is_shared_buffer_with (out0 ))
489
- self .assertFalse (out1_c ._is_shared_buffer_with (out1 ))
490
- self .assertFalse (out2_c ._is_shared_buffer_with (out2 ))
491
-
492
465
def call_unbind (self ):
493
466
x_np = np .random .random (size = [3 , 9 , 5 ]).astype ('float32' )
494
467
x = paddle .to_tensor (x_np )
@@ -622,8 +595,6 @@ def call_unfold(self):
622
595
623
596
self .assertTrue (np .allclose (out_c .numpy (), np_out ))
624
597
625
- self .assertFalse (out_c ._is_shared_buffer_with (out ))
626
-
627
598
def call_stride (self ):
628
599
self .call_transpose ()
629
600
self .call_diagonal ()
0 commit comments