test_print_op.py 459 字节
Newer Older
Y
Yan Chunwei 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
import unittest
import numpy as np
from paddle.v2.fluid.executor import Executor
import paddle.v2.fluid.core as core
import paddle.v2.fluid.layers as pd


class TestSumOp(unittest.TestCase):
    def test_tensor(self):
        i = pd.zeros(shape=[2, 10], dtype='float32')

        pd.Print(i, message="I am a message", summarize=10)

        cpu = core.CPUPlace()
        exe = Executor(cpu)

        exe.run()


if __name__ == '__main__':
    unittest.main()