MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / RandomResizedCropInto

Function RandomResizedCropInto

python/mod_cvcuda/operators/OpRandomResizedCrop.cpp:32–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31namespace {
32Tensor RandomResizedCropInto(Tensor &output, Tensor &input, double min_scale, double max_scale, double min_ratio,
33 double max_ratio, NVCVInterpolationType interp, uint32_t seed,
34 std::optional<Stream> pstream)
35{
36 if (!pstream)
37 {
38 pstream = Stream::Current();
39 }
40
41 int32_t batchSize = static_cast<int32_t>(input.shape()[0]);
42 auto randomResizedCrop
43 = CreateOperator<cvcuda::RandomResizedCrop>(min_scale, max_scale, min_ratio, max_ratio, batchSize, seed);
44
45 ResourceGuard guard(*pstream);
46 guard.add(LockMode::LOCK_MODE_READ, {input});
47 guard.add(LockMode::LOCK_MODE_WRITE, {output});
48 guard.add(LockMode::LOCK_MODE_READWRITE, {*randomResizedCrop});
49
50 randomResizedCrop->submit(pstream->cudaHandle(), input, output, interp);
51
52 return std::move(output);
53}
54
55Tensor RandomResizedCrop(Tensor &input, const Shape &out_shape, double min_scale, double max_scale, double min_ratio,
56 double max_ratio, NVCVInterpolationType interp, uint32_t seed, std::optional<Stream> pstream)

Callers 1

RandomResizedCropFunction · 0.85

Calls 4

cudaHandleMethod · 0.80
shapeMethod · 0.45
addMethod · 0.45
submitMethod · 0.45

Tested by

no test coverage detected