diff --git a/python/paddle/v2/fluid/profiler.py b/python/paddle/v2/fluid/profiler.py index 2dbba72c644d1b9d06e65e19cc7e581b9a668cca..2069b713faf41c5c00ceaf47e030864b98c678da 100644 --- a/python/paddle/v2/fluid/profiler.py +++ b/python/paddle/v2/fluid/profiler.py @@ -22,21 +22,21 @@ def cuda_profiler(output_file, output_mode=None, config=None): `output_file` with Key-Value pair format or Comma separated values format. The user can set the output mode by `output_mode` argument and set the counters/options for profiling by `config` argument. The default config - caontains 'gpustarttimestamp', 'gpustarttimestamp', 'gridsize3d', - 'threadblocksize', 'streamid', 'enableonstart 0', 'conckerneltrace'. + is ['gpustarttimestamp', 'gpustarttimestamp', 'gridsize3d', + 'threadblocksize', 'streamid', 'enableonstart 0', 'conckerneltrace']. Args: output_file (string) : The output file name, the result will be written into this file. output_mode (string) : The output mode has Key-Value pair format and - Comma separated values format. It should be 'kv' or 'csv'. + Comma separated values format. It should be 'kvp' or 'csv'. config (string) : The profiler options and counters can refer to "Compute Command Line Profiler User Guide". """ if output_mode is None: output_mode = 'csv' - if output_mode not in ['kv', 'csv']: - raise ValueError("The output mode must be 'key-value' or 'csv'.") + if output_mode not in ['kvp', 'csv']: + raise ValueError("The output mode must be 'kvp' or 'csv'.") config = NVPROF_CONFIG if config is None else config core.nvprof_init(output_file, output_mode, config) # Enables profiler collection by the active CUDA profiling tool. diff --git a/python/paddle/v2/fluid/tests/test_profiler.py b/python/paddle/v2/fluid/tests/test_profiler.py index e8f24251b9daeb60d689835308d0e908aa502d51..395d0dc36a3d1d6fbfebb4cdf34395c4edee412d 100644 --- a/python/paddle/v2/fluid/tests/test_profiler.py +++ b/python/paddle/v2/fluid/tests/test_profiler.py @@ -20,7 +20,7 @@ class TestProfiler(unittest.TestCase): with profiler.cuda_profiler("cuda_profiler.txt", 'csv') as nvprof: for i in range(epoc): - input = np.random.random(dshape).astype("float32") + input = np.random.random(dshape).astype('float32') exe.run(fluid.default_main_program(), feed={'data': input})