@@ -1516,7 +1516,7 @@ def test_binops_dtype_precedence(self):
1516
1516
# MPS: True + True = False
1517
1517
if binop == 'add' and dtype1 == torch .bool and dtype2 == torch .bool and val1 and val2 :
1518
1518
continue
1519
- # print(f'\n {dtype1},{dtype2}: ({val1}).{binop}({val2})')
1519
+ print (f'{ dtype1 } ,{ dtype2 } : ({ val1 } ).{ binop } ({ val2 } )' )
1520
1520
# print('assert1')
1521
1521
self .assertEqual (
1522
1522
getattr (torch .tensor (val1 , dtype = dtype1 , device = 'mps' ), binop )
@@ -1548,16 +1548,16 @@ def test_binops_dtype_precedence(self):
1548
1548
# TODO: Stateful bug with False, False, add in assert5? Related to the cache key
1549
1549
# or more serious problem?
1550
1550
# - Cache key looks correct, behavior currently completely unexplained
1551
- '''
1551
+ # '''
1552
1552
print ('assert5' )
1553
1553
x1 = torch .full (full_sh , val1 , dtype = dtype1 , device = 'mps' )
1554
1554
y1 = torch .tensor (val2 , dtype = dtype2 , device = 'mps' )
1555
1555
x2 = torch .full (full_sh , val1 , dtype = dtype1 , device = 'cpu' )
1556
1556
y2 = torch .tensor (val2 , dtype = dtype2 , device = 'cpu' )
1557
1557
print ('x1' , x1 , hex (x1 .data_ptr ()))
1558
1558
print ('y1' , y1 , hex (y1 .data_ptr ()))
1559
- # print('x2', x2, hex(x2.data_ptr()))
1560
- # print('y2', y2, hex(y2.data_ptr()))
1559
+ print ('x2' , x2 , hex (x2 .data_ptr ()))
1560
+ print ('y2' , y2 , hex (y2 .data_ptr ()))
1561
1561
self .assertEqual (getattr (x1 , binop )(y1 ), getattr (x2 , binop )(y2 ))
1562
1562
print ('assert6' )
1563
1563
x3 = torch .tensor (val1 , dtype = dtype1 , device = 'mps' )
@@ -1566,8 +1566,8 @@ def test_binops_dtype_precedence(self):
1566
1566
y4 = torch .full (full_sh , val2 , dtype = dtype2 , device = 'cpu' )
1567
1567
print ('x3' , x3 , hex (x3 .data_ptr ()))
1568
1568
print ('y3' , y3 , hex (y3 .data_ptr ()))
1569
- # print('x4', x4, hex(x4.data_ptr()))
1570
- # print('y4', y4, hex(y4.data_ptr()))
1569
+ print ('x4' , x4 , hex (x4 .data_ptr ()))
1570
+ print ('y4' , y4 , hex (y4 .data_ptr ()))
1571
1571
#breakpoint()
1572
1572
self .assertEqual (getattr (x3 , binop )(y3 ), getattr (x4 , binop )(y4 ))
1573
1573
#self.assertEqual(
0 commit comments