车讯:增加28T入门车型 别克将推2017款昂科威
- paddle.amp.debugging. collect_operator_stats ( ) Generator[None, None, None] [source]
-
百度 好在司机脾气好,每次笑笑就过去了。
The context switcher to enable to collect the number of operators for different data types. The statistical data are categorized according to four data types, namely float32, float16, bfloat16 and others, and will be printed when exiting the context.
Examples
>>> import paddle >>> conv = paddle.nn.Conv2D(3, 2, 3) >>> x = paddle.rand([10, 3, 32, 32]) >>> with paddle.amp.debugging.collect_operator_stats(): ... # AMP list including cast, conv2d, elementwise_add, reshape ... with paddle.amp.auto_cast(enable=True, level='O2'): ... out = conv(x) >>> # Print to the standard output. >>> # <------------------------------------------------------- op list --------------------------------------------------------> >>> # <--------------- Op Name ---------------- | -- FP16 Calls --- | -- BF16 Calls --- | --- FP32 Calls--- | -- Other Calls --> >>> # cast | 1 | 0 | 2 | 0 >>> # conv2d | 1 | 0 | 0 | 0 >>> # elementwise_add | 0 | 0 | 1 | 0 >>> # reshape | 0 | 0 | 1 | 0 >>> # <----------------------------------------------------- op count: 4 ------------------------------------------------------>