@@ -772,123 +772,123 @@ def testFloatRemainder(self):
772772 def testLogicalOps (self ):
773773 self ._testBinary (
774774 math_ops .logical_and ,
775- np .array ([[True , False ], [False , True ]], dtype = np .bool ),
776- np .array ([[False , True ], [False , True ]], dtype = np .bool ),
777- expected = np .array ([[False , False ], [False , True ]], dtype = np .bool ))
775+ np .array ([[True , False ], [False , True ]], dtype = np .bool_ ),
776+ np .array ([[False , True ], [False , True ]], dtype = np .bool_ ),
777+ expected = np .array ([[False , False ], [False , True ]], dtype = np .bool_ ))
778778
779779 self ._testBinary (
780780 math_ops .logical_or ,
781- np .array ([[True , False ], [False , True ]], dtype = np .bool ),
782- np .array ([[False , True ], [False , True ]], dtype = np .bool ),
783- expected = np .array ([[True , True ], [False , True ]], dtype = np .bool ))
781+ np .array ([[True , False ], [False , True ]], dtype = np .bool_ ),
782+ np .array ([[False , True ], [False , True ]], dtype = np .bool_ ),
783+ expected = np .array ([[True , True ], [False , True ]], dtype = np .bool_ ))
784784
785785 def testComparisons (self ):
786786 self ._testBinary (
787787 math_ops .equal ,
788788 np .array ([1 , 5 , 20 ], dtype = np .float32 ),
789789 np .array ([10 , 5 , 2 ], dtype = np .float32 ),
790- expected = np .array ([False , True , False ], dtype = np .bool ))
790+ expected = np .array ([False , True , False ], dtype = np .bool_ ))
791791 self ._testBinary (
792792 math_ops .equal ,
793793 np .float32 (5 ),
794794 np .array ([1 , 5 , 20 ], dtype = np .float32 ),
795- expected = np .array ([False , True , False ], dtype = np .bool ))
795+ expected = np .array ([False , True , False ], dtype = np .bool_ ))
796796 self ._testBinary (
797797 math_ops .equal ,
798798 np .array ([[10 ], [7 ], [2 ]], dtype = np .float32 ),
799799 np .float32 (7 ),
800- expected = np .array ([[False ], [True ], [False ]], dtype = np .bool ))
800+ expected = np .array ([[False ], [True ], [False ]], dtype = np .bool_ ))
801801
802802 self ._testBinary (
803803 math_ops .not_equal ,
804804 np .array ([1 , 5 , 20 ], dtype = np .float32 ),
805805 np .array ([10 , 5 , 2 ], dtype = np .float32 ),
806- expected = np .array ([True , False , True ], dtype = np .bool ))
806+ expected = np .array ([True , False , True ], dtype = np .bool_ ))
807807 self ._testBinary (
808808 math_ops .not_equal ,
809809 np .float32 (5 ),
810810 np .array ([1 , 5 , 20 ], dtype = np .float32 ),
811- expected = np .array ([True , False , True ], dtype = np .bool ))
811+ expected = np .array ([True , False , True ], dtype = np .bool_ ))
812812 self ._testBinary (
813813 math_ops .not_equal ,
814814 np .array ([[10 ], [7 ], [2 ]], dtype = np .float32 ),
815815 np .float32 (7 ),
816- expected = np .array ([[True ], [False ], [True ]], dtype = np .bool ))
816+ expected = np .array ([[True ], [False ], [True ]], dtype = np .bool_ ))
817817
818818 for greater_op in [math_ops .greater , (lambda x , y : x > y )]:
819819 self ._testBinary (
820820 greater_op ,
821821 np .array ([1 , 5 , 20 ], dtype = np .float32 ),
822822 np .array ([10 , 5 , 2 ], dtype = np .float32 ),
823- expected = np .array ([False , False , True ], dtype = np .bool ))
823+ expected = np .array ([False , False , True ], dtype = np .bool_ ))
824824 self ._testBinary (
825825 greater_op ,
826826 np .float32 (5 ),
827827 np .array ([1 , 5 , 20 ], dtype = np .float32 ),
828- expected = np .array ([True , False , False ], dtype = np .bool ))
828+ expected = np .array ([True , False , False ], dtype = np .bool_ ))
829829 self ._testBinary (
830830 greater_op ,
831831 np .array ([[10 ], [7 ], [2 ]], dtype = np .float32 ),
832832 np .float32 (7 ),
833- expected = np .array ([[True ], [False ], [False ]], dtype = np .bool ))
833+ expected = np .array ([[True ], [False ], [False ]], dtype = np .bool_ ))
834834
835835 for greater_equal_op in [math_ops .greater_equal , (lambda x , y : x >= y )]:
836836 self ._testBinary (
837837 greater_equal_op ,
838838 np .array ([1 , 5 , 20 ], dtype = np .float32 ),
839839 np .array ([10 , 5 , 2 ], dtype = np .float32 ),
840- expected = np .array ([False , True , True ], dtype = np .bool ))
840+ expected = np .array ([False , True , True ], dtype = np .bool_ ))
841841 self ._testBinary (
842842 greater_equal_op ,
843843 np .float32 (5 ),
844844 np .array ([1 , 5 , 20 ], dtype = np .float32 ),
845- expected = np .array ([True , True , False ], dtype = np .bool ))
845+ expected = np .array ([True , True , False ], dtype = np .bool_ ))
846846 self ._testBinary (
847847 greater_equal_op ,
848848 np .array ([[10 ], [7 ], [2 ]], dtype = np .float32 ),
849849 np .float32 (7 ),
850- expected = np .array ([[True ], [True ], [False ]], dtype = np .bool ))
850+ expected = np .array ([[True ], [True ], [False ]], dtype = np .bool_ ))
851851
852852 for less_op in [math_ops .less , (lambda x , y : x < y )]:
853853 self ._testBinary (
854854 less_op ,
855855 np .array ([1 , 5 , 20 ], dtype = np .float32 ),
856856 np .array ([10 , 5 , 2 ], dtype = np .float32 ),
857- expected = np .array ([True , False , False ], dtype = np .bool ))
857+ expected = np .array ([True , False , False ], dtype = np .bool_ ))
858858 self ._testBinary (
859859 less_op ,
860860 np .float32 (5 ),
861861 np .array ([1 , 5 , 20 ], dtype = np .float32 ),
862- expected = np .array ([False , False , True ], dtype = np .bool ))
862+ expected = np .array ([False , False , True ], dtype = np .bool_ ))
863863 self ._testBinary (
864864 less_op ,
865865 np .array ([[10 ], [7 ], [2 ]], dtype = np .float32 ),
866866 np .float32 (7 ),
867- expected = np .array ([[False ], [False ], [True ]], dtype = np .bool ))
867+ expected = np .array ([[False ], [False ], [True ]], dtype = np .bool_ ))
868868 if np .int64 in self .numeric_types :
869869 self ._testBinary (
870870 less_op ,
871871 np .array ([[10 ], [7 ], [2 ], [- 1 ]], dtype = np .int64 ),
872872 np .int64 (7 ),
873873 expected = np .array (
874- [[False ], [False ], [True ], [True ]], dtype = np .bool ))
874+ [[False ], [False ], [True ], [True ]], dtype = np .bool_ ))
875875
876876 for less_equal_op in [math_ops .less_equal , (lambda x , y : x <= y )]:
877877 self ._testBinary (
878878 less_equal_op ,
879879 np .array ([1 , 5 , 20 ], dtype = np .float32 ),
880880 np .array ([10 , 5 , 2 ], dtype = np .float32 ),
881- expected = np .array ([True , True , False ], dtype = np .bool ))
881+ expected = np .array ([True , True , False ], dtype = np .bool_ ))
882882 self ._testBinary (
883883 less_equal_op ,
884884 np .float32 (5 ),
885885 np .array ([1 , 5 , 20 ], dtype = np .float32 ),
886- expected = np .array ([False , True , True ], dtype = np .bool ))
886+ expected = np .array ([False , True , True ], dtype = np .bool_ ))
887887 self ._testBinary (
888888 less_equal_op ,
889889 np .array ([[10 ], [7 ], [2 ]], dtype = np .float32 ),
890890 np .float32 (7 ),
891- expected = np .array ([[False ], [True ], [True ]], dtype = np .bool ))
891+ expected = np .array ([[False ], [True ], [True ]], dtype = np .bool_ ))
892892
893893 def testS64Comparisons (self ):
894894 for op in [(lambda x , y : x < y ), (lambda x , y : x <= y ),
@@ -961,7 +961,7 @@ def testS64Comparisons(self):
961961 np .int64 (- 1 )
962962 ],
963963 dtype = np .int64 )
964- expected = np .array ([op (l , r ) for l , r in zip (lhs , rhs )], dtype = np .bool )
964+ expected = np .array ([op (l , r ) for l , r in zip (lhs , rhs )], dtype = np .bool_ )
965965 self ._testBinary (op , lhs , rhs , expected = expected )
966966
967967 def testBroadcasting (self ):
0 commit comments