Skip to content

Commit

Permalink
Some clean-up
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Lecki <[email protected]>
  • Loading branch information
klecki committed Nov 19, 2024
1 parent 81062cd commit 4bbfe19
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions dali/operators/bbox/bb_flip.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ DALI_SCHEMA(BbFlip)
.DocStr(R"code(Flips bounding boxes horizontally or vertically (mirror).
The bounding box coordinates for the input are in the [x, y, width, height] - ``xywh`` or
[left, top, right, bottom] - `ltrb` format. All coordinates are in the image coordinate
[left, top, right, bottom] - ``ltrb`` format. All coordinates are in the image coordinate
system, that is 0.0-1.0)code")
.NumInput(1)
.NumOutput(1)
.AddOptionalArg("ltrb",
R"code(True for `ltrb` or False for ``xywh``.)code",
R"code(True for ``ltrb`` or False for ``xywh``.)code",
false, false)
.AddOptionalArg("horizontal",
R"code(Flip horizontal dimension.)code",
Expand Down
2 changes: 1 addition & 1 deletion dali/operators/bbox/bbox_paste.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ canvas and ``(1,1)`` aligns it to bottom-right.
R"code(Ratio of the canvas size to the input size; the value must be at least 1.)code",
DALI_FLOAT, true)
.AddOptionalArg("ltrb",
R"code(True for `ltrb` or False for ``xywh``.)code",
R"code(True for ``ltrb`` or False for ``xywh``.)code",
false, false)
.AddOptionalArg("paste_x",
R"code(Horizontal position of the paste in image coordinates (0.0 - 1.0).)code",
Expand Down
2 changes: 1 addition & 1 deletion dali/operators/decoder/image_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ The slice can be configured by providing start and end coordinates or start and
Relative and absolute arguments can be mixed (for example, `rel_start` can be used with `shape`)
as long as start and shape or end are uniquely defined.
Alternatively, two extra positional inputs can be provided, specifying ``anchor`` and `shape`.
Alternatively, two extra positional inputs can be provided, specifying `__anchor` and `__shape`.
When using positional inputs, two extra boolean arguments `normalized_anchor`/`normalized_shape`
can be used to specify the nature of the arguments provided. Using positional inputs for anchor
and shape is incompatible with the named arguments specified above.
Expand Down
6 changes: 3 additions & 3 deletions dali/operators/generic/erase/erase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ DALI_SCHEMA(Erase)
The region is specified by an `anchor` (starting point) and a `shape` (dimensions).
Only the relevant dimensions are specified.
Not specified dimensions are treated as if the entire range of the axis was provided.
To specify multiple regions, `anchor` and `shape`.represent multiple points consecutively
(for example, `anchor` = (y0, x0, y1, x1, ...) and `shape`.= (h0, w0, h1, w1, ...)).
The `anchor` and `shape`.arguments are interpreted based on the value of the `axis_names`
To specify multiple regions, `anchor` and `shape` represent multiple points consecutively
(for example, `anchor` = (y0, x0, y1, x1, ...) and `shape` = (h0, w0, h1, w1, ...)).
The `anchor` and `shape` arguments are interpreted based on the value of the `axis_names`
argument, or, alternatively, the value of the `axes` argument. If no `axis_names` or
`axes` arguments are provided, all dimensions except ``C`` (channels) must be specified.
Expand Down
4 changes: 2 additions & 2 deletions dali/operators/generic/reshape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ For example, an input of shape ``[480, 640, 3]`` and ``shape = [240, -1]``
results in the output shape ``[240, 3840]``.
.. note::
`rel_shape` and `shape`.are mutually exclusive.
`rel_shape` and `shape` are mutually exclusive.
)code",
std::vector<int>(), true)
.AddOptionalArg<float>("rel_shape", R"code(The relative shape of the output.
Expand All @@ -71,7 +71,7 @@ The number of dimensions is subject to the following restrictions:
the end will be added
.. note::
`rel_shape` and `shape`.are mutually exclusive.
`rel_shape` and `shape` are mutually exclusive.
)code",
std::vector<float>(), true)
.AddOptionalArg("layout", R"code(New layout for the data.
Expand Down
6 changes: 3 additions & 3 deletions dali/operators/generic/slice/slice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ The slice can be configured by providing start and end coordinates or start and
Relative and absolute arguments can be mixed (for example, `rel_start` can be used with `shape`)
as long as start and shape or end are uniquely defined.
Alternatively, two extra positional inputs can be provided, specifying ``anchor`` and `shape`.
Alternatively, two extra positional inputs can be provided, specifying `__anchor` and `__shape`.
When using positional inputs, two extra boolean arguments `normalized_anchor`/`normalized_shape`
can be used to specify the nature of the arguments provided. Using positional inputs for anchor
and shape is incompatible with the named arguments specified above.
.. note::
For GPU backend and positional inputs ``anchor`` and `shape`. both CPU and GPU data nodes
For GPU backend and positional inputs `__anchor` and `shape`, both CPU and GPU data nodes
are accepted, though CPU inputs are preferred.
Providing those arguments as GPU inputs will result in an additional device-to-host copy with
its associated synchronization point.
When possible, provide ``anchor`` and `shape`.as CPU inputs.
When possible, provide `__anchor` and `shape` as CPU inputs.
The slice arguments should provide as many dimensions as specified by the `axis_names` or `axes`
arguments.
Expand Down
4 changes: 2 additions & 2 deletions dali/operators/generic/squeeze.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ Squeeze<Backend>::Squeeze(const OpSpec &spec)
axis_names_ = spec.GetArgument<TensorLayout>("axis_names");

DALI_ENFORCE(spec.HasArgument("axes") + spec.HasArgument("axis_names") == 1,
spec.HasArgument("axes") ? "Provided both `axes` and `axis_names` arguments"
: "Missing argument `axes` or `axis_names`.");
spec.HasArgument("axes") ? "Provided both ``axes`` and ``axis_names`` arguments"
: "Missing argument ``axes`` or ``axis_names``.");

this->use_src_dims_ = true;
}
Expand Down
2 changes: 1 addition & 1 deletion dali/operators/image/convolution/gaussian_blur.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ DALI_SCHEMA(GaussianBlur)
.DocStr(R"code(Applies a Gaussian Blur to the input.
Gaussian blur is calculated by applying a convolution with a Gaussian kernel, which can be
parameterized with ``windows_size`` and `sigma`.
parameterized with `windows_size` and `sigma`.
If only the sigma is specified, the radius of the Gaussian kernel defaults to
``ceil(3 * sigma)``, so the kernel window size is ``2 * ceil(3 * sigma) + 1``.
Expand Down
8 changes: 4 additions & 4 deletions dali/operators/image/crop/bbox_crop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,17 @@ the bounding boxes.
**Outputs: 0**: anchor, 1: shape, 2: bboxes (, 3: labels, 4: bboxes_indices)
The resulting crop parameters are provided as two separate outputs, ``anchor`` and `shape`.
The resulting crop parameters are provided as two separate outputs, `anchor` and `shape`
that can be fed directly to the :meth:`nvidia.dali.fn.slice` operator to complete the cropping
of the original image. ``anchor`` and `shape`.contain the starting coordinates and dimensions
of the original image. `anchor` and `shape` contain the starting coordinates and dimensions
for the crop in the ``[x, y, (z)]`` and ``[w, h, (d)]`` formats, respectively. The coordinates can
be represented in absolute or relative terms, and the representation depends on whether
the fixed `crop_shape` was used.
.. note::
Both ``anchor`` and `shape`.are returned as a ``float``, even if they represent absolute
Both `anchor` and `shape` are returned as a ``float``, even if they represent absolute
coordinates due to providing `crop_shape` argument. In order for them to be interpreted
correctly by :meth:`nvidia.dali.fn.slice`, ``normalized_anchor`` and ``normalized_shape``
correctly by :meth:`nvidia.dali.fn.slice`, `normalized_anchor` and `normalized_shape`
should be set to False.
Expand Down
2 changes: 1 addition & 1 deletion dali/operators/image/resize/resize_crop_mirror.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Supported values:
DALI_SCHEMA(ResizeCropMirror)
.DocStr(R"(Performs a fused resize, crop, mirror operation.
The result of the operation is equivalent to applying ``resize``, followed by `crop` and ``flip``.
The result of the operation is equivalent to applying ``resize``, followed by ``crop`` and ``flip``.
Internally, the operator calculates the relevant region of interest and performs a single
resizing operation on that region.
.)")
Expand Down
2 changes: 1 addition & 1 deletion dali/operators/imgcodec/decoder_schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ The slice can be configured by providing start and end coordinates or start and
Relative and absolute arguments can be mixed (for example, `rel_start` can be used with `shape`)
as long as start and shape or end are uniquely defined.
Alternatively, two extra positional inputs can be provided, specifying ``anchor`` and `shape`.
Alternatively, two extra positional inputs can be provided, specifying `__anchor` and `__shape`.
When using positional inputs, two extra boolean arguments `normalized_anchor`/`normalized_shape`
can be used to specify the nature of the arguments provided. Using positional inputs for anchor
and shape is incompatible with the named arguments specified above.
Expand Down
2 changes: 1 addition & 1 deletion dali/test/python/operator_2/test_squeeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test_squeeze_throw_error():
"Requested a shape with 100 elements but the original shape has 1000 elements.",
"Axis 'C' is not present in the input layout",
"Requested a shape with 1 elements but the original shape has 10 elements.",
"Provided both ``axes`` and `axis_names` arguments",
"Provided both ``axes`` and ``axis_names`` arguments",
"Requested a shape with 100 elements but the original shape has 0 elements.",
"Specified at least twice same dimension to remove.",
]
Expand Down

0 comments on commit 4bbfe19

Please sign in to comment.