Module Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Assign NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Num Num NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Num Num NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Num Num TupleLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr 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 Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr TupleLoad Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Num For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num body Assign TupleStore NameStore NameStore NameStore TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpPow BinOpSub NameLoad NameLoad Num If CompareEq NameLoad Num body AugAssignAdd NameStore NameLoad orelse If CompareEq NameLoad Num body AugAssignAdd NameStore BinOpPow Call NameLoad BinOpSub AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Num Num AugAssignDiv NameStore BinOpMult Num SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr Num FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad NameLoad keyword Num keyword Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr Num FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num decorator_list Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict Str Str Str ListLoad Num Num ListLoad Num Num ListLoad Num Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad
N/A N/A math N/A unittest N/A numpy N/A six N/A chainer chainer cuda chainer functions chainer gradient_check chainer testing chainer.testing attr chainer.testing condition TestContrastive N/A N/A unittest TestCase N/A setUp N/A N/A self N/A N/A N/A x_shape N/A N/A self batchsize N/A self input_dim N/A N/A self x0 N/A N/A N/A N/A N/A numpy random uniform -1 1 x_shape astype N/A numpy float32 N/A N/A self x1 N/A N/A N/A N/A N/A numpy random uniform -1 1 x_shape astype N/A numpy float32 N/A N/A self t N/A N/A N/A N/A N/A numpy random randint 0 2 N/A N/A self batchsize astype N/A numpy int32 N/A check_forward N/A N/A self x0_data x1_data t_data N/A N/A N/A x0_val N/A N/A chainer Variable x0_data N/A x1_val N/A N/A chainer Variable x1_data N/A t_val N/A N/A chainer Variable t_data N/A loss N/A N/A functions contrastive x0_val x1_val t_val N/A self margin N/A N/A N/A self assertEqual N/A N/A loss data shape N/A N/A N/A N/A self assertEqual N/A N/A loss data dtype N/A numpy float32 N/A loss_value N/A float N/A N/A cuda to_cpu N/A loss data N/A loss_expect 0 N/A i N/A N/A N/A six moves range N/A N/A N/A self x0 shape N/A 0 N/A N/A N/A x0d x1d td N/A N/A N/A self x0 N/A i N/A N/A self x1 N/A i N/A N/A self t N/A i N/A d N/A N/A numpy sum N/A N/A x0d x1d 2 N/A N/A td 1 N/A N/A loss_expect d N/A N/A N/A td 0 N/A N/A loss_expect N/A N/A max N/A N/A self margin N/A N/A math sqrt d 0 2 N/A loss_expect N/A 2.0 N/A N/A N/A self t shape N/A 0 N/A N/A N/A self assertAlmostEqual loss_expect loss_value places 5 N/A test_negative_margin N/A N/A self N/A N/A N/A N/A self margin -1 N/A N/A N/A self assertRaises ValueError N/A self check_forward N/A self x0 N/A self x1 N/A self t N/A N/A N/A self assertRaises ValueError N/A self check_backward N/A self x0 N/A self x1 N/A self t N/A test_forward_cpu N/A N/A self N/A N/A N/A N/A N/A self check_forward N/A self x0 N/A self x1 N/A self t N/A N/A N/A condition retry 3 test_forward_gpu_no_cudnn N/A N/A self N/A N/A N/A N/A N/A self check_forward N/A N/A cuda to_gpu N/A self x0 N/A N/A cuda to_gpu N/A self x1 N/A N/A cuda to_gpu N/A self t N/A N/A attr gpu N/A N/A condition retry 3 check_backward N/A N/A self x0_data x1_data t_data N/A N/A N/A N/A N/A gradient_check check_backward N/A N/A functions Contrastive N/A self margin N/A x0_data x1_data t_data None rtol 0.0001 atol 0.0001 N/A test_backward_cpu N/A N/A self N/A N/A N/A N/A N/A self check_backward N/A self x0 N/A self x1 N/A self t N/A N/A N/A condition retry 3 test_backward_gpu_no_cudnn N/A N/A self N/A N/A N/A N/A N/A self check_backward N/A N/A cuda to_gpu N/A self x0 N/A N/A cuda to_gpu N/A self x1 N/A N/A cuda to_gpu N/A self t N/A N/A attr gpu N/A N/A condition retry 3 N/A N/A N/A testing parameterize N/A N/A testing product N/A batchsize input_dim margin N/A 5 10 N/A 2 3 N/A 1 2 N/A N/A N/A testing run_module __name__ __file__