@@ -904,81 +904,81 @@ def test_1d_pooling(pool_type):
904
904
kernel = (4 ,)
905
905
pad = (2 ,)
906
906
stride = (2 ,)
907
-
907
+
908
908
ctx_list = []
909
909
sym_list = []
910
-
910
+
911
911
pooling_convention = 'valid'
912
-
912
+
913
913
ctx_list .append ({'ctx' : mx .cpu (0 ), 'pool_data' : data , 'type_dict' : {'pool_data' : np .float32 }})
914
914
sym_list .append (mx .sym .Pooling (kernel = kernel , pad = pad , stride = stride , pool_type = pool_type ,
915
915
pooling_convention = pooling_convention , global_pool = True , name = 'pool' ))
916
-
916
+
917
917
ctx_list .append ({'ctx' : mx .cpu (0 ), 'pool_data' : data , 'type_dict' : {'pool_data' : np .float32 }})
918
918
sym_list .append (mx .sym .Pooling (kernel = kernel , pool_type = pool_type ,
919
919
pooling_convention = pooling_convention , global_pool = True , name = 'pool' ))
920
-
920
+
921
921
ctx_list .append ({'ctx' : mx .gpu (0 ), 'pool_data' : data , 'type_dict' : {'pool_data' : np .float32 }})
922
922
sym_list .append (mx .sym .Pooling (kernel = kernel , pad = pad , stride = stride , pool_type = pool_type ,
923
923
pooling_convention = pooling_convention , global_pool = True , cudnn_off = False , name = 'pool' ))
924
-
924
+
925
925
ctx_list .append ({'ctx' : mx .gpu (0 ), 'pool_data' : data , 'type_dict' : {'pool_data' : np .float32 }})
926
926
sym_list .append (mx .sym .Pooling (kernel = kernel , pool_type = pool_type ,
927
927
pooling_convention = pooling_convention , global_pool = True , cudnn_off = False , name = 'pool' ))
928
-
928
+
929
929
ctx_list .append ({'ctx' : mx .gpu (0 ), 'pool_data' : data , 'type_dict' : {'pool_data' : np .float32 }})
930
930
sym_list .append (mx .sym .Pooling (kernel = kernel , pad = pad , stride = stride , pool_type = pool_type ,
931
931
pooling_convention = pooling_convention , global_pool = True , cudnn_off = True , name = 'pool' ))
932
-
932
+
933
933
ctx_list .append ({'ctx' : mx .gpu (0 ), 'pool_data' : data , 'type_dict' : {'pool_data' : np .float32 }})
934
934
sym_list .append (mx .sym .Pooling (kernel = kernel , pool_type = pool_type ,
935
935
pooling_convention = pooling_convention , global_pool = True , cudnn_off = True , name = 'pool' ))
936
-
936
+
937
937
check_consistency (sym_list , ctx_list )
938
-
938
+
939
939
def test_2d_pooling (pool_type ):
940
940
data = (2 , 3 , 20 , 20 )
941
941
kernel = (4 , 4 )
942
942
pad = (2 , 2 )
943
943
stride = (2 , 2 )
944
-
944
+
945
945
ctx_list = []
946
946
sym_list = []
947
-
947
+
948
948
pooling_convention = 'valid'
949
-
949
+
950
950
ctx_list .append ({'ctx' : mx .cpu (0 ), 'pool_data' : data , 'type_dict' : {'pool_data' : np .float32 }})
951
951
sym_list .append (mx .sym .Pooling_v1 (kernel = kernel , pad = pad , stride = stride , pool_type = pool_type ,
952
952
pooling_convention = pooling_convention , global_pool = True , name = 'pool' ))
953
-
953
+
954
954
ctx_list .append ({'ctx' : mx .cpu (0 ), 'pool_data' : data , 'type_dict' : {'pool_data' : np .float32 }})
955
955
sym_list .append (mx .sym .Pooling_v1 (kernel = kernel , pool_type = pool_type ,
956
956
pooling_convention = pooling_convention , global_pool = True , name = 'pool' ))
957
-
957
+
958
958
ctx_list .append ({'ctx' : mx .cpu (0 ), 'pool_data' : data , 'type_dict' : {'pool_data' : np .float32 }})
959
959
sym_list .append (mx .sym .Pooling (kernel = kernel , pad = pad , stride = stride , pool_type = pool_type ,
960
960
pooling_convention = pooling_convention , global_pool = True , name = 'pool' ))
961
-
961
+
962
962
ctx_list .append ({'ctx' : mx .cpu (0 ), 'pool_data' : data , 'type_dict' : {'pool_data' : np .float32 }})
963
963
sym_list .append (mx .sym .Pooling (kernel = kernel , pool_type = pool_type ,
964
964
pooling_convention = pooling_convention , global_pool = True , name = 'pool' ))
965
-
965
+
966
966
ctx_list .append ({'ctx' : mx .gpu (0 ), 'pool_data' : data , 'type_dict' : {'pool_data' : np .float32 }})
967
967
sym_list .append (mx .sym .Pooling (kernel = kernel , pad = pad , stride = stride , pool_type = pool_type ,
968
968
pooling_convention = pooling_convention , global_pool = True , cudnn_off = False , name = 'pool' ))
969
-
969
+
970
970
ctx_list .append ({'ctx' : mx .gpu (0 ), 'pool_data' : data , 'type_dict' : {'pool_data' : np .float32 }})
971
971
sym_list .append (mx .sym .Pooling (kernel = kernel , pool_type = pool_type ,
972
972
pooling_convention = pooling_convention , global_pool = True , cudnn_off = False , name = 'pool' ))
973
-
973
+
974
974
ctx_list .append ({'ctx' : mx .gpu (0 ), 'pool_data' : data , 'type_dict' : {'pool_data' : np .float32 }})
975
975
sym_list .append (mx .sym .Pooling (kernel = kernel , pad = pad , stride = stride , pool_type = pool_type ,
976
976
pooling_convention = pooling_convention , global_pool = True , cudnn_off = True , name = 'pool' ))
977
-
977
+
978
978
ctx_list .append ({'ctx' : mx .gpu (0 ), 'pool_data' : data , 'type_dict' : {'pool_data' : np .float32 }})
979
979
sym_list .append (mx .sym .Pooling (kernel = kernel , pool_type = pool_type ,
980
980
pooling_convention = pooling_convention , global_pool = True , cudnn_off = True , name = 'pool' ))
981
-
981
+
982
982
check_consistency (sym_list , ctx_list )
983
983
984
984
test_1d_pooling ('max' )
@@ -1784,3 +1784,4 @@ def test_kernel_error_checking():
1784
1784
if __name__ == '__main__' :
1785
1785
import nose
1786
1786
nose .runmodule ()
1787
+
0 commit comments