| 72 | } |
| 73 | |
| 74 | ImageBatchVarShape VarShapeNormalizeInto(ImageBatchVarShape &output, ImageBatchVarShape &input, Tensor &base, |
| 75 | Tensor &scale, std::optional<uint32_t> flags, float globalScale, |
| 76 | float globalShift, float epsilon, std::optional<Stream> pstream) |
| 77 | { |
| 78 | if (!pstream) |
| 79 | { |
| 80 | pstream = Stream::Current(); |
| 81 | } |
| 82 | |
| 83 | if (!flags) |
| 84 | { |
| 85 | flags = 0; |
| 86 | } |
| 87 | |
| 88 | auto normalize = CreateOperator<cvcuda::Normalize>(); |
| 89 | |
| 90 | ResourceGuard guard(*pstream); |
| 91 | guard.add(LockMode::LOCK_MODE_READ, {input, base, scale}); |
| 92 | guard.add(LockMode::LOCK_MODE_WRITE, {output}); |
| 93 | guard.add(LockMode::LOCK_MODE_NONE, {*normalize}); |
| 94 | |
| 95 | normalize->submit(pstream->cudaHandle(), input, base, scale, output, globalScale, globalShift, epsilon, *flags); |
| 96 | |
| 97 | return output; |
| 98 | } |
| 99 | |
| 100 | ImageBatchVarShape VarShapeNormalize(ImageBatchVarShape &input, Tensor &base, Tensor &scale, |
| 101 | std::optional<uint32_t> flags, float globalScale, float globalShift, float epsilon, |
no test coverage detected