PaddlePaddle / PaddleClas

A treasure chest for visual classification and recognition powered by PaddlePaddle
Apache License 2.0
5.32k stars 1.15k forks source link

refine drop_path #3132

Closed wanghuancoder closed 1 month ago

wanghuancoder commented 2 months ago

drop_path将1个float转换为Tensor,使用了to_tensor。to_tensor会使用阻塞式的H2D拷贝,导致Python端阻塞,进而导致无法预加载kernel,导致GPU利用率低。 改为full可以解决这个问题。

paddle-bot[bot] commented 2 months ago

Thanks for your contribution!

TingquanGao commented 2 months ago

我看了下文档,测试了下。paddle.to_tensor(value)得到的是一个0-D Tensor,所以是否应该使用paddle.full(shape=[], value)这样?