# tensorplay.cuda.profiler API Source: https://www.tensorplay.cn/docs/api/tensorplay.cuda.profiler.html ## Functions 3 [#](#api-tensorplay.cuda.profiler.profile) ### profile function[Full reference ↗](/docs/generated/tensorplay.cuda.profiler.profile.html) ```python tensorplay.cuda.profiler.profile() ``` Enable profiling. Context Manager to enabling profile collection by the active profiling tool from CUDA backend. .. rubric:: Example ``` >>> import tensorplay as tp >>> model = tp.nn.Linear(20, 30).cuda() >>> inputs = tp.randn(128, 20).cuda() >>> with tp.cuda.profiler.profile(): ... model(inputs) ``` [#](#api-tensorplay.cuda.profiler.start) ### start function[Full reference ↗](/docs/generated/tensorplay.cuda.profiler.start.html) ```python tensorplay.cuda.profiler.start() ``` Starts cuda profiler data collection. > **Warning** > > Raises CudaError in case of it is unable to start the profiler. [#](#api-tensorplay.cuda.profiler.stop) ### stop function[Full reference ↗](/docs/generated/tensorplay.cuda.profiler.stop.html) ```python tensorplay.cuda.profiler.stop() ``` Stops cuda profiler data collection. > **Warning** > > Raises CudaError in case of it is unable to stop the profiler.