| 212 | } |
| 213 | |
| 214 | ImageBatchVarShape VarShapePillowResizeInto(ImageBatchVarShape &output, ImageBatchVarShape &input, |
| 215 | NVCVInterpolationType interpolation, std::optional<Stream> pstream) |
| 216 | { |
| 217 | if (!pstream) |
| 218 | { |
| 219 | pstream = Stream::Current(); |
| 220 | } |
| 221 | |
| 222 | // The same PyOpPillowResize class and CreateOperatorEx function can be used regardless of Tensors or VarShape. |
| 223 | auto pillowResize = CreateOperatorEx<PyOpPillowResize>(); |
| 224 | |
| 225 | ResourceGuard guard(*pstream); |
| 226 | guard.add(LockMode::LOCK_MODE_READ, {input}); |
| 227 | guard.add(LockMode::LOCK_MODE_WRITE, {output}); |
| 228 | guard.add(LockMode::LOCK_MODE_READWRITE, {*pillowResize}); |
| 229 | |
| 230 | pillowResize->submit(pstream->cudaHandle(), input, output, interpolation); |
| 231 | |
| 232 | return output; |
| 233 | } |
| 234 | |
| 235 | ImageBatchVarShape VarShapePillowResize(ImageBatchVarShape &input, const std::vector<std::tuple<int, int>> &outSizes, |
| 236 | NVCVInterpolationType interpolation, std::optional<Stream> pstream) |
no test coverage detected