Module Expr Str ImportFrom alias alias alias Import alias Import alias ImportFrom alias ImportFrom alias Import alias identifier Import alias ImportFrom alias alias alias alias alias FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad TupleLoad Num Num Str body Expr Str If CompareLt AttributeLoad NameLoad attr Num body Raise Call NameLoad Str If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str keyword Num Assign NameStore NameLoad If CompareEq AttributeLoad NameLoad attr Num body Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad Return NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num NameLoad Call AttributeLoad NameLoad attr ListLoad Num NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword Num Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Num SubscriptLoad AttributeLoad NameLoad attr Slice Num SubscriptLoad AttributeLoad NameLoad attr Slice Num Return Call AttributeLoad NameLoad attr NameLoad NameLoad keyword AttributeLoad NameLoad attr decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore TupleLoad Str Str Str Str Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad TupleLoad Num Num body Expr Str If CompareLt Call NameLoad NameLoad Num body Raise Call NameLoad Str If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Slice Num AugAssignAdd NameStore BinOpMult SubscriptLoad NameLoad Index Num Num AugAssignAdd NameStore BinOpMult SubscriptLoad NameLoad Index Num Num If NameLoad body If CompareEq SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num body Assign NameStore BinOpFloorDiv NameLoad SubscriptLoad NameLoad Index Num orelse Assign NameStore BinOpAdd BinOpFloorDiv BinOpSub NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num If CompareEq SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num body Assign NameStore BinOpFloorDiv NameLoad SubscriptLoad NameLoad Index Num orelse Assign NameStore BinOpAdd BinOpFloorDiv BinOpSub NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num BinOpAdd BinOpFloorDiv BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num Num BinOpAdd Call AttributeLoad NameLoad attr Num BinOpAdd BinOpFloorDiv BinOpSub BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num Num orelse If CompareGtE SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num body Assign NameStore BinOpAdd BinOpFloorDiv BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num Num orelse Assign NameStore BinOpAdd Call NameLoad Num BinOpAdd BinOpFloorDiv BinOpSub BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num Num If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num BinOpAdd BinOpFloorDiv BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num Num BinOpAdd Call AttributeLoad NameLoad attr Num BinOpAdd BinOpFloorDiv BinOpSub BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num Num orelse If CompareGtE SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num body Assign NameStore BinOpAdd BinOpFloorDiv BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num Num orelse Assign NameStore BinOpAdd Call NameLoad Num BinOpAdd BinOpFloorDiv BinOpSub BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num Num Assign NameStore BinOpAdd Call NameLoad SubscriptLoad NameLoad Slice Num ListLoad NameLoad NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad TupleLoad Num Num Str body Assign AttributeStore NameLoad attr Call NameLoad NameLoad If UnaryOpNot Call NameLoad ListComp Call NameLoad NameLoad NameLoad comprehension NameStore NameLoad body Raise Call NameLoad BinOpMod Str Call NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Assert Call NameLoad NameLoad TupleLoad NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad If BoolOpAnd CompareNotEq AttributeLoad NameLoad attr TupleLoad Num Num UnaryOpNot NameLoad body Raise Call NameLoad Str If BoolOpOr CompareGtE SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num CompareGtE SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num body Raise Call NameLoad Str If CompareNotIn NameLoad ListLoad Str Str Str Str body Raise Call NameLoad BinOpMod Str NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareNotEq AttributeLoad AttributeLoad NameLoad attr attr Num body Raise Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Slice Num TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad ListLoad NameLoad ListLoad Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameLoad Assign TupleStore NameStore NameLoad If CompareNotEq Call NameLoad AttributeLoad NameLoad attr Num body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr If BoolOpOr CompareIs SubscriptLoad NameLoad Index Num NameLoad CompareNotEq AttributeLoad SubscriptLoad NameLoad Index Num attr NameLoad body Assign SubscriptStore NameLoad Index Num Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num BinOpMult Num NameLoad Assign NameStore BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num BinOpMult Num NameLoad Assign NameStore CompareEq AttributeLoad NameLoad attr Str If CompareNotEq AttributeLoad NameLoad attr TupleLoad Num Num body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign SubscriptStore NameLoad ExtSlice Slice Slice Slice NameLoad BinOpSub NameLoad NameLoad Slice NameLoad BinOpSub NameLoad NameLoad NameLoad orelse Assign NameStore NameLoad Assign NameStore AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore AttributeLoad NameLoad attr orelse If CompareNotEq AttributeLoad NameLoad attr Str body Assign NameStore AttributeLoad NameLoad attr For NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body For NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body For NameStore Call NameLoad NameLoad body Assign NameStore BinOpMult NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad NameLoad If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad For NameStore Call NameLoad NameLoad body Assign NameStore BinOpMult NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad NameLoad If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad NameLoad NameLoad Call NameLoad SubscriptLoad NameLoad ExtSlice Index NameLoad Index NameLoad Slice NameLoad NameLoad Slice NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return ListLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameLoad Assign TupleStore NameStore NameLoad If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call NameLoad NameLoad Return ListLoad Call Call NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr NameLoad NameLoad NameLoad orelse Return ListLoad Call Call NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return ListLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body If CompareNotIn AttributeLoad NameLoad attr TupleLoad Str Str Str Str body Raise Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign TupleStore NameStore NameLoad Assign TupleStore NameStore NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore Str If CompareEq AttributeLoad NameLoad attr Str body AugAssignAdd NameStore Str orelse If CompareIn AttributeLoad NameLoad attr TupleLoad Str Str Str body AugAssignAdd NameStore Str If CompareEq AttributeLoad NameLoad attr Str body AugAssignAdd NameStore Str orelse If BoolOpAnd CompareEq AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr body AugAssignAdd NameStore Str orelse AugAssignAdd NameStore Str AugAssignAdd NameStore Str Return BinOpMod NameLoad Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return TupleLoad Num Num Num Num decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore TupleLoad Str Str Str Str Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad TupleLoad Num Num body Expr Str If CompareLt Call NameLoad NameLoad Num body Raise Call NameLoad Str If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Slice Num AugAssignAdd NameStore BinOpMult SubscriptLoad NameLoad Index Num Num AugAssignAdd NameStore BinOpMult SubscriptLoad NameLoad Index Num Num If NameLoad body Assign NameStore BinOpAdd BinOpFloorDiv BinOpSub NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num Assign NameStore BinOpAdd BinOpFloorDiv BinOpSub NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num BinOpAdd BinOpFloorDiv BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num Num BinOpAdd Call AttributeLoad NameLoad attr Num BinOpAdd BinOpFloorDiv BinOpSub BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num Num orelse If CompareGtE SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num body Assign NameStore BinOpAdd BinOpFloorDiv BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num Num orelse Assign NameStore BinOpAdd Call NameLoad Num BinOpAdd BinOpFloorDiv BinOpSub BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num Num If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num BinOpAdd BinOpFloorDiv BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num Num BinOpAdd Call AttributeLoad NameLoad attr Num BinOpAdd BinOpFloorDiv BinOpSub BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num Num orelse If CompareGtE SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num body Assign NameStore BinOpAdd BinOpFloorDiv BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num Num orelse Assign NameStore BinOpAdd Call NameLoad Num BinOpAdd BinOpFloorDiv BinOpSub BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num Num Assign NameStore BinOpAdd Call NameLoad SubscriptLoad NameLoad Slice Num ListLoad NameLoad NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad TupleLoad Num Num Str body Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad If CompareNotIn NameLoad ListLoad Str Str Str Str body Raise Call NameLoad BinOpMod Str NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Return ListLoad SubscriptLoad NameLoad Index Num decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad TupleLoad Num Num body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assert BoolOpAnd Call NameLoad NameLoad NameLoad CompareEq AttributeLoad NameLoad attr Num Assert BoolOpAnd Call NameLoad NameLoad NameLoad CompareEq AttributeLoad NameLoad attr Num Assert BoolOpAnd Call NameLoad NameLoad NameLoad CompareEq AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad ListLoad NameLoad NameLoad NameLoad ListLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assert CompareEq AttributeLoad NameLoad attr Str Assign TupleStore NameStore NameStore NameStore NameLoad Assign TupleStore NameStore NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num BinOpMult Num NameLoad Assign NameStore BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num BinOpMult Num NameLoad If CompareNotEq AttributeLoad NameLoad attr TupleLoad Num Num body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign SubscriptStore NameLoad ExtSlice Slice Slice Slice NameLoad BinOpSub NameLoad NameLoad Slice NameLoad BinOpSub NameLoad NameLoad NameLoad orelse Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body For NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body For NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr BinOpMult NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr BinOpMult NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad NameLoad body For NameStore Call NameLoad NameLoad NameLoad body If CompareEq SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad NameLoad body AugAssignAdd SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Slice Slice NameLoad BinOpSub NameLoad NameLoad Slice NameLoad BinOpSub NameLoad NameLoad Assign SubscriptStore NameLoad Index Num NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameStore NameLoad Assign TupleStore NameStore NameLoad Return ListLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call Call NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assert CompareEq AttributeLoad NameLoad attr Str Assign TupleStore NameStore NameStore NameStore NameLoad Assign TupleStore NameStore NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Return BinOpMod Str Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return TupleLoad Num Num decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad TupleLoad Num Num Str body Assert CompareIn NameLoad ListLoad Str Str Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Assert BoolOpAnd Call NameLoad NameLoad NameLoad CompareEq AttributeLoad NameLoad attr Num Assert BoolOpAnd Call NameLoad NameLoad NameLoad CompareEq AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad ListLoad NameLoad NameLoad ListLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If BoolOpAnd CompareEq AttributeLoad NameLoad attr Str CompareNotEq AttributeLoad NameLoad attr TupleLoad Num Num body Raise Call NameLoad Assign TupleStore NameStore NameStore NameLoad Assign TupleStore NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr If BoolOpOr CompareIs SubscriptLoad NameLoad Index Num NameLoad CompareNotEq AttributeLoad SubscriptLoad NameLoad Index Num attr NameLoad body Assign SubscriptStore NameLoad Index Num Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num BinOpMult Num NameLoad Assign NameStore BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num BinOpMult Num NameLoad Assign NameStore CompareEq AttributeLoad NameLoad attr Str Assign NameStore CompareEq AttributeLoad NameLoad attr Str If CompareNotEq AttributeLoad NameLoad attr TupleLoad Num Num body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign SubscriptStore NameLoad ExtSlice Slice Slice Slice NameLoad BinOpSub NameLoad NameLoad Slice NameLoad BinOpSub NameLoad NameLoad NameLoad orelse Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body For NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body For NameStore Call NameLoad NameLoad body If BoolOpOr NameLoad NameLoad body Assign NameStore BinOpMult NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr BinOpMult NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body If BoolOpOr NameLoad NameLoad body Assign NameStore BinOpMult NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr BinOpMult NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad NameLoad If NameLoad body Assign NameStore SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad NameLoad orelse Assign NameStore BinOpDiv SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad NameLoad BinOpMult BinOpSub NameLoad NameLoad BinOpSub NameLoad NameLoad AugAssignAdd SubscriptStore NameLoad ExtSlice Index NameLoad Index NameLoad Slice NameLoad NameLoad Slice NameLoad NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Slice Slice NameLoad BinOpSub NameLoad NameLoad Slice NameLoad BinOpSub NameLoad NameLoad Assign SubscriptStore NameLoad Index Num NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameLoad Assign TupleStore NameStore NameLoad Return ListLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call Call NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore TupleLoad Str Str Str Str Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad TupleLoad Num Num Str body Assign AttributeStore NameLoad attr Call NameLoad NameLoad If UnaryOpNot Call NameLoad ListComp Call NameLoad NameLoad NameLoad comprehension NameStore NameLoad body Raise Call NameLoad BinOpMod Str Call NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Assert Call NameLoad NameLoad TupleLoad NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad If BoolOpAnd CompareNotEq AttributeLoad NameLoad attr TupleLoad Num Num UnaryOpNot NameLoad body Raise Call NameLoad Str If BoolOpOr CompareGtE SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num CompareGtE SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num body Raise Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad Assert CompareEq AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareEq AttributeLoad NameLoad attr Num Assert CompareEq AttributeLoad NameLoad attr Num Assert CompareEq AttributeLoad NameLoad attr Num Return Call NameLoad NameLoad ListLoad NameLoad NameLoad NameLoad ListLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore NameStore NameLoad Assign TupleStore NameStore NameLoad If CompareNotEq Call NameLoad AttributeLoad NameLoad attr Num body Raise Call NameLoad Str If BoolOpOr CompareIs SubscriptLoad NameLoad Index Num NameLoad CompareNotEq AttributeLoad SubscriptLoad NameLoad Index Num attr AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Num Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num BinOpMult Num NameLoad Assign NameStore BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num BinOpMult Num NameLoad If CompareNotEq AttributeLoad NameLoad attr TupleLoad Num Num body Assign NameStore BinOpSub BinOpAdd Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad NameLoad keyword AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num Assign SubscriptStore NameLoad ExtSlice Slice Slice Slice NameLoad BinOpSub NameLoad NameLoad Slice NameLoad BinOpSub NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign SubscriptStore NameLoad ExtSlice Slice Slice Slice NameLoad BinOpSub NameLoad NameLoad Slice NameLoad BinOpSub NameLoad NameLoad NameLoad orelse Assign NameStore NameLoad Assign NameStore NameLoad For NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body For NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body For NameStore Call NameLoad NameLoad body Assign NameStore BinOpMult NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign NameStore BinOpMult NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad NameLoad body For NameStore Call NameLoad NameLoad NameLoad body If CompareEq SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad NameLoad body Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Return ListLoad SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body If CompareNotEq AttributeLoad NameLoad attr Str body Raise Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign TupleStore NameStore NameStore NameStore NameLoad Assign TupleStore NameStore NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Return BinOpMod Str Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return TupleLoad Num Num decorator_list decorator_list
N/A N/A 
Ops for downsampling images.
Planned:
Pool, DownsampleAvg, DownsampleSoftmax.
 __future__ absolute_import print_function division N/A warnings N/A numpy six integer_types six.moves xrange N/A six.moves.builtins builtins N/A theano theano gof Op tensor Variable Apply max_pool_2d_same_size N/A N/A input patch_size N/A N/A N/A 
    Takes as input a 4-D tensor. It sets all non maximum values
    of non-overlapping patches of size (patch_size[0],patch_size[1]) to zero,
    keeping only the maximum values. The output has the same dimensions as
    the input.

    Parameters
    ----------
    input : 4-D theano tensor of input images
        Input images. Max pooling will be done over the 2 last dimensions.
    patch_size : tuple of length 2
        Size of the patch (patch height, patch width).
        (2,2) will retain only one non-zero value per patch of 4 values.

     N/A output N/A N/A Pool patch_size True input N/A outs N/A N/A MaxPoolGrad patch_size True input output output N/A outs N/A pool_2d N/A N/A input ds ignore_border st padding mode N/A None None N/A 0 0 max N/A N/A Downscale the input by a specified factor

    Takes as input a N-D tensor, where N >= 2. It downscales the input image by
    the specified factor, by keeping only the maximum value of non-overlapping
    patches of size (ds[0],ds[1])

    Parameters
    ----------
    input : N-D theano tensor of input images
        Input images. Max pooling will be done over the 2 last dimensions.
    ds : tuple of length 2
        Factor by which to downscale (vertical ds, horizontal ds).
        (2,2) will halve the image in each dimension.
    ignore_border : bool (default None, will print a warning and set to False)
        When True, (5,5) input with ds=(2,2) will generate a (2,2) output.
        (3,3) otherwise.
    st : tuple of two ints
        Stride size, which is the number of shifts over rows/cols to get the
        next pool region. If st is None, it is considered equal to ds
        (no overlap on pooling regions).
    padding : tuple of two ints
        (pad_h, pad_w), pad zeros to extend beyond four borders of the
        images, pad_h is the size of the top and bottom margins, and
        pad_w is the size of the left and right margins.
    mode : {'max', 'sum', 'average_inc_pad', 'average_exc_pad'}
        Operation executed on each window. `max` and `sum` always exclude
        the padding in the computation. `average` gives you the choice to
        include or exclude it.

     N/A N/A N/A input ndim 2 N/A N/A N/A NotImplementedError pool_2d requires a dimension >= 2 N/A N/A ignore_border None N/A N/A N/A N/A warnings warn pool_2d() will have the parameter ignore_border default value changed to True (currently False). To have consistent behavior with all Theano version, explicitly add the parameter ignore_border=True. On the GPU, using ignore_border=True is needed to use cuDNN. When using ignore_border=False and not using cuDNN, the only GPU combination supported is when `ds == st and padding == (0, 0) and mode == 'max'`. Otherwise, the convolution will be executed on CPU. stacklevel 2 N/A ignore_border False N/A N/A N/A input ndim 4 N/A N/A op N/A Pool ds ignore_border st st padding padding mode mode N/A output N/A op input N/A output N/A img_shape N/A N/A input shape N/A -2 N/A batch_size N/A N/A tensor prod N/A N/A input shape N/A -2 N/A batch_size N/A N/A tensor shape_padright batch_size 1 N/A new_shape N/A N/A tensor cast N/A N/A tensor join 0 batch_size N/A N/A tensor as_tensor N/A 1 img_shape int64 N/A input_4D N/A N/A tensor reshape input new_shape ndim 4 N/A op N/A Pool ds ignore_border st st padding padding mode mode N/A output N/A op input_4D N/A outshp N/A N/A tensor join 0 N/A N/A input shape N/A -2 N/A N/A output shape N/A -2 N/A N/A N/A tensor reshape output outshp ndim N/A input ndim N/A Pool N/A Op N/A N/A 
    For N-dimensional tensors, consider that the last two dimensions span
    images. This Op downsamples these images by taking the max, sum or average
    over different patch.

    The constructor takes the max, sum or average or different input patches.

    Parameters
    ----------
    ds : list or tuple of two ints
        Downsample factor over rows and column.
        ds indicates the pool region size.
    ignore_border : bool
        If ds doesn't divide imgshape, do we include an extra row/col
        of partial downsampling (False) or ignore it (True).
    st : list or tuple of two ints or None
        Stride size, which is the number of shifts over rows/cols to get the
        next pool region. If st is None, it is considered equal to ds
        (no overlap on pooling regions).
    padding: tuple of two ints
        (pad_h, pad_w), pad zeros to extend beyond four borders of the images,
        pad_h is the size of the top and bottom margins, and pad_w is the size
        of the left and right margins.
    mode : {'max', 'sum', 'average_inc_pad', 'average_exc_pad'}
        ('average_inc_pad' excludes the padding from the count,
        'average_exc_pad' include it)

     N/A __props__ N/A ds ignore_border st padding mode out_shape N/A N/A imgshape ds ignore_border st padding N/A False None N/A 0 0 N/A N/A 
        Return the shape of the output from this op, for input of given
        shape and flags.

        Parameters
        ----------
        imgshape : tuple, list, or similar of integer or scalar Theano variable
            The shape of a tensor of images. The last two elements are
            interpreted as the number of rows, and the number of cols.
        ds : list or tuple of two ints
            Downsample factor over rows and columns this parameter indicates
            the size of the pooling region.
        st : list or tuple of two ints
            The stride size. This is the distance between the pooling regions.
            If it's set to None, it equals ds.
        ignore_border : bool
            If ds doesn't divide imgshape, do we include an extra row/col of
            partial downsampling (False) or ignore it (True).
        padding : tuple of two ints
            (pad_h, pad_w), pad zeros to extend beyond four borders
            of the images, pad_h is the size of the top and bottom margins,
            and pad_w is the size of the left and right margins.

        Returns
        -------
        list
            The shape of the output from this op, for input of given shape.
            This will have the same length as imgshape, but with last two
            elements reduced as per the downsampling & ignore_border flags.

         N/A N/A N/A len imgshape 2 N/A N/A N/A TypeError imgshape must have at least two elements (rows, cols) N/A N/A st None N/A N/A st ds N/A N/A r c N/A imgshape N/A -2 N/A r N/A N/A padding N/A 0 2 N/A c N/A N/A padding N/A 1 2 N/A ignore_border N/A N/A N/A N/A ds N/A 0 N/A st N/A 0 N/A N/A nr N/A r N/A st N/A 0 N/A N/A out_r N/A N/A N/A r N/A ds N/A 0 N/A st N/A 0 1 N/A N/A isinstance r N/A theano Variable N/A N/A nr N/A N/A tensor maximum out_r 0 N/A N/A nr N/A N/A numpy maximum out_r 0 N/A N/A N/A ds N/A 1 N/A st N/A 1 N/A N/A nc N/A c N/A st N/A 1 N/A N/A out_c N/A N/A N/A c N/A ds N/A 1 N/A st N/A 1 1 N/A N/A isinstance c N/A theano Variable N/A N/A nc N/A N/A tensor maximum out_c 0 N/A N/A nc N/A N/A numpy maximum out_c 0 N/A N/A N/A isinstance r N/A theano Variable N/A N/A nr N/A N/A tensor switch N/A N/A tensor ge N/A st N/A 0 N/A ds N/A 0 N/A N/A N/A r 1 N/A st N/A 0 1 N/A N/A N/A tensor maximum 0 N/A N/A N/A N/A r 1 N/A ds N/A 0 N/A st N/A 0 1 1 N/A N/A N/A N/A st N/A 0 N/A ds N/A 0 N/A N/A nr N/A N/A N/A r 1 N/A st N/A 0 1 N/A N/A nr N/A N/A max 0 N/A N/A N/A N/A r 1 N/A ds N/A 0 N/A st N/A 0 1 1 N/A N/A isinstance c N/A theano Variable N/A N/A nc N/A N/A tensor switch N/A N/A tensor ge N/A st N/A 1 N/A ds N/A 1 N/A N/A N/A c 1 N/A st N/A 1 1 N/A N/A N/A tensor maximum 0 N/A N/A N/A N/A c 1 N/A ds N/A 1 N/A st N/A 1 1 1 N/A N/A N/A N/A st N/A 1 N/A ds N/A 1 N/A N/A nc N/A N/A N/A c 1 N/A st N/A 1 1 N/A N/A nc N/A N/A max 0 N/A N/A N/A N/A c 1 N/A ds N/A 1 N/A st N/A 1 1 1 N/A rval N/A N/A list N/A imgshape N/A -2 N/A nr nc N/A rval N/A staticmethod __init__ N/A N/A self ds ignore_border st padding mode N/A False None N/A 0 0 max N/A N/A N/A self ds N/A tuple ds N/A N/A N/A all N/A N/A isinstance d integer_types N/A d ds N/A N/A N/A ValueError N/A Pool downsample parameters must be ints. Got %s N/A str ds N/A N/A st None N/A N/A st ds N/A N/A isinstance st N/A tuple list N/A N/A self st N/A tuple st N/A N/A self ignore_border ignore_border N/A N/A self padding N/A tuple padding N/A N/A N/A N/A self padding N/A 0 0 N/A ignore_border N/A N/A N/A NotImplementedError padding works only with ignore_border=True N/A N/A N/A N/A N/A self padding N/A 0 N/A N/A self ds N/A 0 N/A N/A N/A self padding N/A 1 N/A N/A self ds N/A 1 N/A N/A N/A NotImplementedError padding_h and padding_w must be smaller than strides N/A N/A mode N/A max average_inc_pad average_exc_pad sum N/A N/A N/A ValueError N/A Pool mode parameter only support 'max', 'sum', 'average_inc_pad' and 'average_exc_pad'. Got %s mode N/A N/A self mode mode N/A make_node N/A N/A self x N/A N/A N/A N/A N/A N/A x type ndim 4 N/A N/A N/A TypeError N/A x N/A N/A tensor as_tensor_variable x N/A broad N/A N/A N/A x broadcastable N/A 2 N/A False False N/A out N/A N/A tensor TensorType N/A x dtype broad N/A N/A N/A gof Apply self N/A x N/A N/A out N/A perform N/A N/A self node inp out N/A N/A N/A N/A x inp N/A N/A z out N/A N/A N/A len N/A x shape 4 N/A N/A N/A NotImplementedError Pool requires 4D input for now N/A z_shape N/A N/A self out_shape N/A x shape N/A self ds N/A self ignore_border N/A self st N/A self padding N/A N/A N/A N/A z N/A 0 None N/A N/A N/A z N/A 0 shape z_shape N/A N/A N/A z N/A 0 N/A N/A numpy empty z_shape dtype N/A x dtype N/A zz N/A z N/A 0 N/A pr N/A N/A zz shape N/A -2 N/A pc N/A N/A zz shape N/A -1 N/A N/A ds0 ds1 N/A self ds N/A N/A st0 st1 N/A self st N/A pad_h N/A N/A self padding N/A 0 N/A pad_w N/A N/A self padding N/A 1 N/A img_rows N/A N/A N/A x shape N/A -2 N/A 2 pad_h N/A img_cols N/A N/A N/A x shape N/A -1 N/A 2 pad_w N/A inc_pad N/A N/A self mode average_inc_pad N/A N/A N/A self padding N/A 0 0 N/A N/A y N/A N/A numpy zeros N/A N/A N/A x shape N/A 0 N/A N/A x shape N/A 1 img_rows img_cols dtype N/A x dtype N/A N/A y N/A N/A N/A N/A pad_h N/A img_rows pad_h N/A pad_w N/A img_cols pad_w x N/A N/A y x N/A func N/A numpy max N/A N/A N/A self mode sum N/A N/A func N/A numpy sum N/A N/A N/A N/A self mode max N/A N/A func N/A numpy average N/A n N/A xrange N/A N/A x shape N/A 0 N/A N/A k N/A xrange N/A N/A x shape N/A 1 N/A N/A r N/A xrange pr N/A N/A row_st N/A r st0 N/A row_end N/A N/A builtins min N/A row_st ds0 img_rows N/A N/A inc_pad N/A N/A row_st N/A N/A builtins max row_st N/A N/A self padding N/A 0 N/A row_end N/A N/A builtins min row_end N/A N/A N/A x shape N/A -2 pad_h N/A c N/A xrange pc N/A N/A col_st N/A c st1 N/A col_end N/A N/A builtins min N/A col_st ds1 img_cols N/A N/A inc_pad N/A N/A col_st N/A N/A builtins max col_st N/A N/A self padding N/A 1 N/A col_end N/A N/A builtins min col_end N/A N/A N/A x shape N/A -1 pad_w N/A N/A zz N/A N/A n k r c N/A func N/A y N/A N/A n N/A k N/A row_st row_end N/A col_st col_end N/A infer_shape N/A N/A self node in_shapes N/A N/A N/A shp N/A N/A self out_shape N/A in_shapes N/A 0 N/A self ds N/A self ignore_border N/A self st N/A self padding N/A N/A shp N/A grad N/A N/A self inp grads N/A N/A N/A N/A x inp N/A N/A gz grads N/A N/A N/A self mode max N/A N/A maxout N/A self x N/A N/A N/A N/A MaxPoolGrad N/A self ds ignore_border N/A self ignore_border st N/A self st padding N/A self padding x maxout gz N/A N/A N/A N/A N/A AveragePoolGrad N/A self ds ignore_border N/A self ignore_border st N/A self st padding N/A self padding mode N/A self mode x gz N/A c_headers N/A N/A self N/A N/A N/A N/A <algorithm> N/A c_code N/A N/A self node name inp out sub N/A N/A N/A N/A N/A self mode N/A max sum average_exc_pad average_inc_pad N/A N/A N/A N/A N/A N/A theano gof utils MethodNotDefined N/A N/A x inp N/A N/A z out N/A fail N/A sub N/A fail N/A ignore_border N/A int N/A self ignore_border N/A N/A ds0 ds1 N/A self ds N/A N/A st0 st1 N/A self st N/A N/A pd0 pd1 N/A self padding N/A ccode 
        int typenum = PyArray_ObjectType((PyObject*)%(x)s, 0);
        int z_r, z_c; // shape of the output
        int r, c; // shape of the padded_input
        if(PyArray_NDIM(%(x)s)!=4)
        {
            PyErr_SetString(PyExc_ValueError, "x must be a 4d ndarray");
            %(fail)s;
        }
        r = PyArray_DIMS(%(x)s)[2];
        c = PyArray_DIMS(%(x)s)[3];
        r += %(pd0)s * 2;
        c += %(pd1)s * 2;
        if (%(pd0)s != 0 && %(pd1)s != 0 && !%(ignore_border)s)
            {
              PyErr_SetString(PyExc_ValueError,
                "padding must be (0,0) when ignore border is False");
              %(fail)s;
            }
        if (%(ignore_border)s)
        {
            // '/' in C is different from '/' in python
            if (r - %(ds0)s < 0)
            {
              z_r = 0;
            }
            else
            {
              z_r = (r - %(ds0)s) / %(st0)s + 1;
            }
            if (c - %(ds1)s < 0)
            {
              z_c = 0;
            }
            else
            {
              z_c = (c - %(ds1)s) / %(st1)s + 1;
            }
        }
        else
        {
            // decide how many rows the output has
            if (%(st0)s >= %(ds0)s)
            {
                z_r = (r - 1) / %(st0)s + 1;
            }
            else
            {
                z_r = std::max(0, (r - 1 - %(ds0)s) / %(st0)s + 1) + 1;
            }
            // decide how many columns the output has
            if (%(st1)s >= %(ds1)s)
            {
                z_c = (c - 1) / %(st1)s + 1;
            }
            else
            {
                z_c = std::max(0, (c - 1 - %(ds1)s) / %(st1)s + 1) + 1;
            }
        }
        // memory allocation of z if necessary
        if ((!%(z)s)
          || *PyArray_DIMS(%(z)s)!=4
          ||(PyArray_DIMS(%(z)s)[0] != PyArray_DIMS(%(x)s)[0])
          ||(PyArray_DIMS(%(z)s)[1] != PyArray_DIMS(%(x)s)[1])
          ||(PyArray_DIMS(%(z)s)[2] != z_r)
          ||(PyArray_DIMS(%(z)s)[3] != z_c)
          )
        {
          if (%(z)s) Py_XDECREF(%(z)s);
          npy_intp dims[4] = {0,0,0,0};
          dims[0]=PyArray_DIMS(%(x)s)[0];
          dims[1]=PyArray_DIMS(%(x)s)[1];
          dims[2]=z_r;
          dims[3]=z_c;
          //TODO: zeros not necessary
          %(z)s = (PyArrayObject*) PyArray_ZEROS(4, dims, typenum,0);
        }
        // used for indexing a pool region inside the input
        int r_st, r_end, c_st, c_end;
        dtype_%(x)s collector; // temp var for the value in a region
        if (z_r && z_c)
        {
            for(int b=0; b<PyArray_DIMS(%(x)s)[0]; b++){
              for(int k=0; k<PyArray_DIMS(%(x)s)[1]; k++){
                for(int i=0; i< z_r; i++){
                  r_st = i * %(st0)s;
                  r_end = r_st + %(ds0)s;
                  // skip the padding
                  r_st = r_st < %(pd0)s ? %(pd0)s : r_st;
                  r_end = r_end > (r - %(pd0)s) ? r - %(pd0)s : r_end;
                  // from padded_img space to img space
                  r_st -= %(pd0)s;
                  r_end -= %(pd0)s;
                  // handle the case where no padding, ignore border is True
                  if (%(ignore_border)s)
                  {
                    r_end = r_end > r ? r : r_end;
                  }
                  for(int j=0; j<z_c; j++){
                    c_st = j * %(st1)s;
                    c_end = c_st + %(ds1)s;
                    // skip the padding
                    c_st = c_st < %(pd1)s ? %(pd1)s : c_st;
                    c_end = c_end > (c - %(pd1)s) ? c - %(pd1)s : c_end;
                    dtype_%(z)s * z = (
                          (dtype_%(z)s*)(PyArray_GETPTR4(%(z)s, b, k, i, j)));
                    // change coordinates from padding_img space into img space
                    c_st -= %(pd1)s;
                    c_end -= %(pd1)s;
                    // handle the case where no padding, ignore border is True
                    if (%(ignore_border)s)
                    {
                      c_end = c_end > c ? c : c_end;
                    }
         N/A N/A N/A self mode max N/A N/A ccode 
                    // use the first element as the initial value of collector
                    collector = ((dtype_%(x)s*)(PyArray_GETPTR4(%(x)s,b,k,r_st,c_st)))[0];
                    // go through the pooled region in the unpadded input
                    for(int m=r_st; m<r_end; m++)
                    {
                      for(int n=c_st; n<c_end; n++)
                      {
                        dtype_%(x)s a = ((dtype_%(x)s*)(PyArray_GETPTR4(%(x)s,b,k,m,n)))[0];
                        collector = (a > collector) ? a : collector;
                      }
                    }
                    z[0] = collector;
             N/A N/A N/A N/A self mode N/A sum average_exc_pad average_inc_pad N/A N/A ccode 
                    // initialize the sum at zero
                    collector = ((dtype_%(x)s)(0));
                    // go through the pooled region in the unpadded input
                    for(int m=r_st; m<r_end; m++)
                    {
                      for(int n=c_st; n<c_end; n++)
                      {
                        dtype_%(x)s a = ((dtype_%(x)s*)(PyArray_GETPTR4(%(x)s,b,k,m,n)))[0];
                        collector += a;
                      }
                    }
             N/A N/A N/A self mode sum N/A N/A ccode 
                    z[0] = collector;
                 N/A N/A N/A N/A N/A self mode average_inc_pad N/A self ignore_border N/A N/A ccode 
                    z[0] = collector / (%(ds0)s * %(ds1)s);
                 N/A N/A ccode 
                    z[0] = collector / ((r_end-r_st)*(c_end-c_st));
                 N/A ccode 
                  }
                }
              }
            }
        }
         N/A N/A ccode N/A locals N/A c_code_cache_version N/A N/A self N/A N/A N/A N/A 0 6 8 3 N/A N/A PoolGrad N/A Op N/A N/A __props__ N/A ds ignore_border st padding mode out_shape N/A N/A imgshape ds ignore_border st padding N/A False None N/A 0 0 N/A N/A Return the shape of the output from this op, for input of given
        shape and flags.

        Parameters
        ----------
        imgshape : tuple of integers or scalar Theano variables
            the shape of a tensor of images. The last two elements are
            interpreted as the number of rows, and the number of cols.
        ds : tuple of two ints
            downsample factor over rows and columns this parameter
            indicates the size of the pooling region
        st : tuple of two ints
            the stride size. This is the distance between the pooling
            regions. If it's set to None, in which case it equlas ds.
        ignore_border : bool
            if ds doesn't divide imgshape, do we include an extra
            row/col of partial downsampling (False) or ignore it
            (True).
        padding : tuple of two ints
            (pad_h, pad_w), pad zeros to extend beyond four borders of
            the images, pad_h is the size of the top and bottom
            margins, and pad_w is the size of the left and right
            margins.

        Returns
        -------
        list :
            the shape of the output from this op, for input of given
            shape.  This will have the same length as imgshape, but
            with last two elements reduced as per the downsampling &
            ignore_border flags.

         N/A N/A N/A len imgshape 2 N/A N/A N/A TypeError imgshape must have at least two elements (rows, cols) N/A N/A st None N/A N/A st ds N/A N/A r c N/A imgshape N/A -2 N/A r N/A N/A padding N/A 0 2 N/A c N/A N/A padding N/A 1 2 N/A ignore_border N/A N/A out_r N/A N/A N/A r N/A ds N/A 0 N/A st N/A 0 1 N/A out_c N/A N/A N/A c N/A ds N/A 1 N/A st N/A 1 1 N/A N/A isinstance r N/A theano Variable N/A N/A nr N/A N/A tensor maximum out_r 0 N/A N/A nr N/A N/A numpy maximum out_r 0 N/A N/A isinstance c N/A theano Variable N/A N/A nc N/A N/A tensor maximum out_c 0 N/A N/A nc N/A N/A numpy maximum out_c 0 N/A N/A N/A isinstance r N/A theano Variable N/A N/A nr N/A N/A tensor switch N/A N/A tensor ge N/A st N/A 0 N/A ds N/A 0 N/A N/A N/A r 1 N/A st N/A 0 1 N/A N/A N/A tensor maximum 0 N/A N/A N/A N/A r 1 N/A ds N/A 0 N/A st N/A 0 1 1 N/A N/A N/A N/A st N/A 0 N/A ds N/A 0 N/A N/A nr N/A N/A N/A r 1 N/A st N/A 0 1 N/A N/A nr N/A N/A max 0 N/A N/A N/A N/A r 1 N/A ds N/A 0 N/A st N/A 0 1 1 N/A N/A isinstance c N/A theano Variable N/A N/A nc N/A N/A tensor switch N/A N/A tensor ge N/A st N/A 1 N/A ds N/A 1 N/A N/A N/A c 1 N/A st N/A 1 1 N/A N/A N/A tensor maximum 0 N/A N/A N/A N/A c 1 N/A ds N/A 1 N/A st N/A 1 1 1 N/A N/A N/A N/A st N/A 1 N/A ds N/A 1 N/A N/A nc N/A N/A N/A c 1 N/A st N/A 1 1 N/A N/A nc N/A N/A max 0 N/A N/A N/A N/A c 1 N/A ds N/A 1 N/A st N/A 1 1 1 N/A rval N/A N/A list N/A imgshape N/A -2 N/A nr nc N/A rval N/A staticmethod __init__ N/A N/A self ds ignore_border st padding mode N/A None N/A 0 0 max N/A N/A N/A self ds N/A tuple ds N/A N/A self ignore_border ignore_border N/A N/A st None N/A N/A st ds N/A N/A self st N/A tuple st N/A N/A self padding N/A tuple padding N/A N/A mode N/A max sum average_inc_pad average_exc_pad N/A N/A N/A ValueError N/A Pool mode parameter only support 'max', 'sum', 'average_inc_pad' and 'average_exc_pad'. Got %s mode N/A N/A self mode mode N/A infer_shape N/A N/A self node in_shapes N/A N/A N/A N/A N/A in_shapes N/A 0 N/A N/A MaxPoolGrad N/A PoolGrad N/A __init__ N/A N/A self ds ignore_border st padding N/A None N/A 0 0 N/A N/A N/A N/A PoolGrad __init__ self ds ignore_border st padding mode max N/A make_node N/A N/A self x maxout gz N/A N/A N/A N/A N/A isinstance x Variable N/A N/A x ndim 4 N/A N/A N/A isinstance maxout Variable N/A N/A maxout ndim 4 N/A N/A N/A isinstance gz Variable N/A N/A gz ndim 4 N/A x N/A N/A tensor as_tensor_variable x N/A maxout N/A N/A tensor as_tensor_variable maxout N/A gz N/A N/A tensor as_tensor_variable gz N/A N/A Apply self N/A x maxout gz N/A N/A N/A x type N/A perform N/A N/A self node inp out N/A N/A N/A N/A N/A self mode max N/A N/A x maxout gz inp N/A N/A gx_stg out N/A pr N/A N/A maxout shape N/A -2 N/A pc N/A N/A maxout shape N/A -1 N/A N/A ds0 ds1 N/A self ds N/A N/A st0 st1 N/A self st N/A pad_h N/A N/A self padding N/A 0 N/A pad_w N/A N/A self padding N/A 1 N/A img_rows N/A N/A N/A x shape N/A -2 N/A 2 pad_h N/A img_cols N/A N/A N/A x shape N/A -1 N/A 2 pad_w N/A N/A N/A self padding N/A 0 0 N/A N/A y N/A N/A numpy zeros N/A N/A N/A x shape N/A 0 N/A N/A x shape N/A 1 img_rows img_cols dtype N/A x dtype N/A N/A y N/A N/A N/A N/A pad_h N/A img_rows pad_h N/A pad_w N/A img_cols pad_w x N/A N/A y x N/A gx N/A N/A numpy zeros_like y N/A n N/A xrange N/A N/A x shape N/A 0 N/A N/A k N/A xrange N/A N/A x shape N/A 1 N/A N/A r N/A xrange pr N/A N/A row_st N/A N/A builtins max N/A r st0 N/A N/A self padding N/A 0 N/A row_end N/A N/A builtins min N/A row_st ds0 img_rows N/A c N/A xrange pc N/A N/A col_st N/A N/A builtins max N/A c st1 N/A N/A self padding N/A 1 N/A col_end N/A N/A builtins min N/A col_st ds1 img_cols N/A row_ind N/A xrange row_st row_end N/A N/A col_ind N/A xrange col_st col_end N/A N/A N/A N/A maxout N/A N/A n k r c N/A y N/A N/A n k row_ind col_ind N/A N/A N/A gx N/A N/A n k row_ind col_ind N/A gz N/A N/A n k r c N/A gx N/A gx N/A N/A N/A N/A pad_h N/A img_rows pad_h N/A pad_w N/A img_cols pad_w N/A N/A gx_stg N/A 0 gx N/A grad N/A N/A self inp grads N/A N/A N/A N/A x maxout gz inp N/A N/A ggx grads N/A N/A N/A N/A N/A theano tensor zeros_like x N/A N/A N/A theano tensor zeros_like maxout N/A N/A DownsampleFactorMaxGradGrad N/A self ds ignore_border N/A self ignore_border st N/A self st padding N/A self padding x maxout ggx N/A c_code N/A N/A self node name inp out sub N/A N/A N/A N/A N/A self mode max N/A N/A x z gz inp N/A N/A gx out N/A fail N/A sub N/A fail N/A ignore_border N/A int N/A self ignore_border N/A N/A ds0 ds1 N/A self ds N/A N/A st0 st1 N/A self st N/A N/A pd0 pd1 N/A self padding N/A N/A 
        // sanity checks
        int x_typenum = PyArray_ObjectType((PyObject*)%(x)s, 0);
        int z_typenum = PyArray_ObjectType((PyObject*)%(z)s, 0);
        int gz_typenum = PyArray_ObjectType((PyObject*)%(gz)s, 0);
        if ((x_typenum != z_typenum) || (x_typenum != gz_typenum))
        {
            PyErr_SetString(PyExc_ValueError, "input types must all match");
            %(fail)s;
        }
        if(PyArray_NDIM(%(x)s)!=4)
        {
            PyErr_SetString(PyExc_ValueError, "x must be a 4d ndarray");
            %(fail)s;
        }
        if(PyArray_NDIM(%(z)s)!=4)
        {
            PyErr_SetString(PyExc_ValueError, "z must be a 4d ndarray");
            %(fail)s;
        }
        if(PyArray_NDIM(%(gz)s)!=4)
        {
            PyErr_SetString(PyExc_ValueError, "gz must be a 4d ndarray");
            %(fail)s;
        }
        int z_r, z_c;
        z_r = PyArray_DIMS(%(z)s)[2];
        z_c = PyArray_DIMS(%(z)s)[3];
        int r, c; // shape of the padded_input
        r = PyArray_DIMS(%(x)s)[2];
        c = PyArray_DIMS(%(x)s)[3];
        r += %(pd0)s * 2;
        c += %(pd1)s * 2;
        // allocating memory for gx
        if ((!%(gx)s)
          || !PyArray_ISCONTIGUOUS(%(gx)s)
          || *PyArray_DIMS(%(gx)s)!=4
          ||(PyArray_DIMS(%(gx)s)[0] != PyArray_DIMS(%(x)s)[0])
          ||(PyArray_DIMS(%(gx)s)[1] != PyArray_DIMS(%(x)s)[1])
          ||(PyArray_DIMS(%(gx)s)[2] != PyArray_DIMS(%(x)s)[2])
          ||(PyArray_DIMS(%(gx)s)[3] != PyArray_DIMS(%(x)s)[3])
          )
        {
          Py_XDECREF(%(gx)s);
          %(gx)s = (PyArrayObject*) PyArray_ZEROS(4, PyArray_DIMS(%(x)s), x_typenum,0);
        }
        else {
          PyArray_FILLWBYTE(%(gx)s, 0);
        }
        int r_st, r_end, c_st, c_end; // used to index into the input img x
        dtype_%(z)s maximum; // temp var for maximum value in a region
        if (z_r && z_c)
        {
            for(int b=0; b<PyArray_DIMS(%(x)s)[0]; b++){
              for(int k=0; k<PyArray_DIMS(%(x)s)[1]; k++){
                for(int i=0; i< z_r; i++){
                  r_st = i * %(st0)s;
                  r_end = r_st + %(ds0)s;
                  // skip the padding
                  r_st = r_st < %(pd0)s ? %(pd0)s : r_st;
                  r_end = r_end > (r - %(pd0)s) ? r - %(pd0)s : r_end;
                  // from padded_img space to img space
                  r_st -= %(pd0)s;
                  r_end -= %(pd0)s;
                  for(int j=0; j<z_c; j++){
                    c_st = j * %(st1)s;
                    c_end = c_st + %(ds1)s;
                    // skip the padding
                    c_st = c_st < %(pd1)s ? %(pd1)s : c_st;
                    c_end = c_end > (c - %(pd1)s) ? c - %(pd1)s : c_end;
                    // change coordinates from padding_img space into img space
                    c_st -= %(pd1)s;
                    c_end -= %(pd1)s;
                    // the maximum value
                    maximum = ((dtype_%(z)s*)(PyArray_GETPTR4(%(z)s,b,k,i,j)))[0];
                    // the gradient corresponding to this maximum value in z
                    dtype_%(gz)s * gz = (
                          (dtype_%(gz)s*)(PyArray_GETPTR4(%(gz)s, b, k, i, j)));
                    // go through the pooled region in the unpadded input
                    for(int m=r_st; m<r_end; m++)
                    {
                      for(int n=c_st; n<c_end; n++)
                      {
                        dtype_%(x)s a = ((dtype_%(x)s*)(PyArray_GETPTR4(%(x)s,b,k,m,n)))[0];
                        dtype_%(gx)s * gx = (
                          (dtype_%(gx)s*)(PyArray_GETPTR4(%(gx)s, b, k, m, n)));
                        if (a == maximum){
                          gx[0] = gx[0] + gz[0];
                        }
                      }
                    }
                  }
                }
              }
            }
        }
         N/A locals N/A c_code_cache_version N/A N/A self N/A N/A N/A N/A 0 7 N/A N/A AveragePoolGrad N/A PoolGrad N/A __init__ N/A N/A self ds ignore_border st padding mode N/A None N/A 0 0 average_inc_pad N/A N/A N/A mode N/A sum average_inc_pad average_exc_pad N/A N/A N/A PoolGrad __init__ self ds ignore_border st padding mode N/A make_node N/A N/A self x gz dummy N/A None N/A N/A N/A N/A isinstance x Variable N/A N/A x ndim 4 N/A N/A N/A isinstance gz Variable N/A N/A gz ndim 4 N/A x N/A N/A tensor as_tensor_variable x N/A gz N/A N/A tensor as_tensor_variable gz N/A N/A Apply self N/A x gz N/A N/A N/A x type N/A perform N/A N/A self node inp out N/A N/A N/A N/A N/A N/A self mode average_exc_pad N/A N/A self padding N/A 0 0 N/A N/A N/A NotImplementedError N/A N/A x gz inp N/A N/A gx_stg out N/A z_shape N/A N/A self out_shape N/A x shape N/A self ds N/A self ignore_border N/A self st N/A self padding N/A N/A N/A N/A gx_stg N/A 0 None N/A N/A N/A gx_stg N/A 0 shape z_shape N/A N/A N/A gx_stg N/A 0 N/A N/A numpy empty z_shape dtype N/A x dtype N/A zz N/A gx_stg N/A 0 N/A pr N/A N/A zz shape N/A -2 N/A pc N/A N/A zz shape N/A -1 N/A N/A ds0 ds1 N/A self ds N/A N/A st0 st1 N/A self st N/A pad_h N/A N/A self padding N/A 0 N/A pad_w N/A N/A self padding N/A 1 N/A img_rows N/A N/A N/A x shape N/A -2 N/A 2 pad_h N/A img_cols N/A N/A N/A x shape N/A -1 N/A 2 pad_w N/A inc_pad N/A N/A self mode average_inc_pad N/A sum_mode N/A N/A self mode sum N/A N/A N/A self padding N/A 0 0 N/A N/A y N/A N/A numpy zeros N/A N/A N/A x shape N/A 0 N/A N/A x shape N/A 1 img_rows img_cols dtype N/A x dtype N/A N/A y N/A N/A N/A N/A pad_h N/A img_rows pad_h N/A pad_w N/A img_cols pad_w x N/A N/A y x N/A gx N/A N/A numpy zeros_like y N/A n N/A xrange N/A N/A x shape N/A 0 N/A N/A k N/A xrange N/A N/A x shape N/A 1 N/A N/A r N/A xrange pr N/A N/A N/A sum_mode inc_pad N/A N/A row_st N/A r st0 N/A N/A row_st N/A N/A builtins max N/A r st0 N/A N/A self padding N/A 0 N/A row_end N/A N/A builtins min N/A row_st ds0 img_rows N/A c N/A xrange pc N/A N/A N/A sum_mode inc_pad N/A N/A col_st N/A c st1 N/A N/A col_st N/A N/A builtins max N/A c st1 N/A N/A self padding N/A 1 N/A col_end N/A N/A builtins min N/A col_st ds1 img_cols N/A sum_mode N/A N/A val N/A gz N/A N/A n k r c N/A N/A val N/A N/A gz N/A N/A n k r c N/A N/A row_end row_st N/A col_end col_st N/A N/A gx N/A N/A n N/A k N/A row_st row_end N/A col_st col_end val N/A gx N/A gx N/A N/A N/A N/A pad_h N/A img_rows pad_h N/A pad_w N/A img_cols pad_w N/A N/A gx_stg N/A 0 gx N/A grad N/A N/A self inp grads N/A N/A N/A N/A x gz inp N/A N/A ggx grads N/A N/A N/A N/A N/A theano tensor zeros_like x N/A N/A Pool N/A self ds ignore_border N/A self ignore_border st N/A self st padding N/A self padding mode N/A self mode ggx N/A N/A DownsampleFactorMaxGradGrad N/A Op N/A N/A __props__ N/A ds ignore_border st padding mode __init__ N/A N/A self ds ignore_border st padding mode N/A None N/A 0 0 max N/A N/A N/A self ds N/A tuple ds N/A N/A N/A all N/A N/A isinstance d integer_types N/A d ds N/A N/A N/A ValueError N/A Pool downsample parameters must be ints. Got %s N/A str ds N/A N/A st None N/A N/A st ds N/A N/A isinstance st N/A tuple list N/A N/A self st N/A tuple st N/A N/A self ignore_border ignore_border N/A N/A self padding N/A tuple padding N/A N/A N/A N/A self padding N/A 0 0 N/A ignore_border N/A N/A N/A NotImplementedError padding works only with ignore_border=True N/A N/A N/A N/A N/A self padding N/A 0 N/A N/A self ds N/A 0 N/A N/A N/A self padding N/A 1 N/A N/A self ds N/A 1 N/A N/A N/A NotImplementedError padding_h and padding_w must be smaller than strides N/A N/A self mode mode N/A N/A N/A self mode max N/A make_node N/A N/A self x maxout gz N/A N/A N/A x N/A N/A tensor as_tensor_variable x N/A maxout N/A N/A tensor as_tensor_variable maxout N/A gz N/A N/A tensor as_tensor_variable gz N/A N/A N/A x ndim 4 N/A N/A N/A maxout ndim 4 N/A N/A N/A gz ndim 4 N/A N/A Apply self N/A x maxout gz N/A N/A N/A x type N/A perform N/A N/A self node inp out N/A N/A N/A N/A x maxout ggx inp N/A N/A z out N/A N/A N/A len N/A x shape 4 N/A N/A N/A NotImplementedError DownsampleFactorMaxGradGrad requires 4D input for now N/A N/A N/A N/A z N/A 0 None N/A N/A N/A z N/A 0 shape N/A maxout shape N/A N/A N/A z N/A 0 N/A N/A numpy zeros N/A maxout shape dtype N/A x dtype N/A ggz N/A z N/A 0 N/A pr N/A N/A ggz shape N/A -2 N/A pc N/A N/A ggz shape N/A -1 N/A N/A ds0 ds1 N/A self ds N/A N/A st0 st1 N/A self st N/A N/A pd0 pd1 N/A self padding N/A img_rows N/A N/A N/A x shape N/A -2 N/A 2 pd0 N/A img_cols N/A N/A N/A x shape N/A -1 N/A 2 pd1 N/A N/A N/A self padding N/A 0 0 N/A N/A y_padded N/A N/A N/A N/A numpy zeros N/A N/A N/A x shape N/A 0 N/A N/A x shape N/A 1 img_rows img_cols dtype N/A x dtype N/A N/A x min 1 N/A N/A y_padded N/A N/A N/A N/A pd0 N/A img_rows pd0 N/A pd1 N/A img_cols pd1 x N/A ggx_padded N/A N/A numpy zeros N/A N/A N/A x shape N/A 0 N/A N/A x shape N/A 1 img_rows img_cols dtype N/A x dtype N/A N/A ggx_padded N/A N/A N/A N/A pd0 N/A img_rows pd0 N/A pd1 N/A img_cols pd1 ggx N/A N/A y_padded x N/A ggx_padded ggx N/A n N/A xrange N/A N/A x shape N/A 0 N/A N/A k N/A xrange N/A N/A x shape N/A 1 N/A N/A r N/A xrange pr N/A N/A row_st N/A r st0 N/A row_end N/A N/A builtins min N/A row_st ds0 img_rows N/A c N/A xrange pc N/A N/A col_st N/A c st1 N/A col_end N/A N/A builtins min N/A col_st ds1 img_cols N/A row_ind N/A xrange row_st row_end N/A N/A col_ind N/A xrange col_st col_end N/A N/A N/A N/A maxout N/A N/A n k r c N/A y_padded N/A N/A n k row_ind col_ind N/A N/A N/A ggz N/A N/A n k r c N/A ggx_padded N/A N/A n k row_ind col_ind N/A infer_shape N/A N/A self node in_shapes N/A N/A N/A N/A N/A in_shapes N/A 1 N/A c_code N/A N/A self node name inp out sub N/A N/A N/A N/A N/A self mode max N/A N/A N/A N/A N/A N/A theano gof utils MethodNotDefined N/A N/A x maxout ggx inp N/A N/A z out N/A fail N/A sub N/A fail N/A ignore_border N/A int N/A self ignore_border N/A N/A ds0 ds1 N/A self ds N/A N/A st0 st1 N/A self st N/A N/A pd0 pd1 N/A self padding N/A N/A 
        int z_typenum = PyArray_ObjectType((PyObject*)%(maxout)s, 0);
        int z_r, z_c;
        z_r = PyArray_DIMS(%(maxout)s)[2];
        z_c = PyArray_DIMS(%(maxout)s)[3];
        int r, c; // shape of the padded_input
        r = PyArray_DIMS(%(x)s)[2];
        c = PyArray_DIMS(%(x)s)[3];
        r += %(pd0)s * 2;
        c += %(pd1)s * 2;
        // allocating memory for output
        if ((!%(z)s)
          || !PyArray_ISCONTIGUOUS(%(z)s)
          || *PyArray_DIMS(%(z)s)!=4
          ||(PyArray_DIMS(%(z)s)[0] != PyArray_DIMS(%(maxout)s)[0])
          ||(PyArray_DIMS(%(z)s)[1] != PyArray_DIMS(%(maxout)s)[1])
          ||(PyArray_DIMS(%(z)s)[2] != PyArray_DIMS(%(maxout)s)[2])
          ||(PyArray_DIMS(%(z)s)[3] != PyArray_DIMS(%(maxout)s)[3])
          )
        {
          Py_XDECREF(%(z)s);
          %(z)s = (PyArrayObject*) PyArray_ZEROS(4, PyArray_DIMS(%(maxout)s), z_typenum,0);
        }
        else {
          PyArray_FILLWBYTE(%(z)s, 0);
        }
        dtype_%(maxout)s maximum; // temp var for maximum value in a region
        int r_st, r_end, c_st, c_end; // used to index into the input img x
        for(int b=0; b<PyArray_DIMS(%(x)s)[0]; b++){
              for(int k=0; k<PyArray_DIMS(%(x)s)[1]; k++){
                for(int i=0; i< z_r; i++){
                  r_st = i * %(st0)s;
                  r_end = r_st + %(ds0)s;
                  // skip the padding
                  r_st = r_st < %(pd0)s ? %(pd0)s : r_st;
                  r_end = r_end > (r - %(pd0)s) ? r - %(pd0)s : r_end;
                  // from padded_img space to img space
                  r_st -= %(pd0)s;
                  r_end -= %(pd0)s;
                  for(int j=0; j<z_c; j++){
                    c_st = j * %(st1)s;
                    c_end = c_st + %(ds1)s;
                    // skip the padding
                    c_st = c_st < %(pd1)s ? %(pd1)s : c_st;
                    c_end = c_end > (c - %(pd1)s) ? c - %(pd1)s : c_end;
                    // from padding_img space into img space
                    c_st -= %(pd1)s;
                    c_end -= %(pd1)s;
                    // the maximum value
                    maximum = ((dtype_%(maxout)s*)(PyArray_GETPTR4(%(maxout)s,b,k,i,j)))[0];
                    // z at this position
                    dtype_%(z)s * z = ((dtype_%(z)s*)(PyArray_GETPTR4(%(z)s, b, k, i, j)));
                    // go through the pooled region in the unpadded input
                    for(int m=r_st; m<r_end; m++)
                    {
                      for(int n=c_st; n<c_end; n++)
                      {
                        dtype_%(x)s a = ((dtype_%(x)s*)(PyArray_GETPTR4(%(x)s,b,k,m,n)))[0];
                        dtype_%(ggx)s * ggx = (
                          (dtype_%(ggx)s*)(PyArray_GETPTR4(%(ggx)s, b, k, m, n)));
                        if (a == maximum){
                          z[0] += ggx[0];
                        }
                      }
                    }
                  }
                }
              }
         }
         N/A locals N/A c_code_cache_version N/A N/A self N/A N/A N/A N/A 0 1 N/A N/A