Skip to content

Commit

Permalink
Replace all parameter references from double backticks to single (#5716)
Browse files Browse the repository at this point in the history
Semi-automatically search for all parameters wrapped in double backticks
and replace them with single backticks so that the sphinx automation can
recognize them and inject the :paramref: directive allowing for proper linking
to parameters via their references.

Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
  • Loading branch information
klecki authored Nov 25, 2024
1 parent af97a0c commit c4f280c
Show file tree
Hide file tree
Showing 100 changed files with 628 additions and 629 deletions.
8 changes: 4 additions & 4 deletions dali/operators/audio/nonsilence_op.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright (c) 2020-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -22,13 +22,13 @@ DALI_SCHEMA(NonsilentRegion)
.DocStr(R"code(Performs leading and trailing silence detection in an audio buffer.
The operator returns the beginning and length of the non-silent region by comparing the
short term power calculated for ``window_length`` of the signal with a silence cut-off threshold.
short term power calculated for `window_length` of the signal with a silence cut-off threshold.
The signal is considered to be silent when the ``short_term_power_db`` is less than
the ``cutoff_db``. where::
the `cutoff_db`. where::
short_term_power_db = 10 * log10( short_term_power / reference_power )
Unless specified otherwise, ``reference_power`` is the maximum power of the signal.
Unless specified otherwise, `reference_power` is the maximum power of the signal.
Inputs and outputs:
Expand Down
4 changes: 2 additions & 2 deletions dali/operators/audio/preemphasis_filter_op.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2019-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright (c) 2019-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,7 +30,7 @@ This filter, in simple form, can be expressed by the formula::
with ``X`` and ``Y`` being the input and output signal, respectively.
The value of ``X_border`` depends on the ``border`` argument::
The value of ``X_border`` depends on the `border` argument::
X_border = 0 if border_type == 'zero'
X_border = X[0] if border_type == 'clamp'
Expand Down
24 changes: 12 additions & 12 deletions dali/operators/audio/resample.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -26,7 +26,7 @@ DALI_SCHEMA(AudioResample)
.DocStr(R"(Resamples an audio signal.
The resampling is achieved by applying a sinc filter with Hann window with an extent
controlled by the ``quality`` argument.
controlled by the `quality` argument.
The resampling ratio can be specified directly or as a ratio of target to source sampling rate,
or calculated from the ratio of the requested output length to the input length.
Expand All @@ -35,33 +35,33 @@ or calculated from the ratio of the requested output length to the input length.
.NumOutput(1)
.AddOptionalArg<float>("in_rate", R"(Input sampling rate.
The sampling rate of the input sample. This parameter must be specified together with ``out_rate``.
The value is relative to ``out_rate`` and doesn't need to use any specific unit as long as the
The sampling rate of the input sample. This parameter must be specified together with `out_rate`.
The value is relative to `out_rate` and doesn't need to use any specific unit as long as the
units of input and output rates match.
The ``in_rate`` and ``out_rate`` parameters cannot be specified together with ``scale`` or
``out_length``.)",
The `in_rate` and `out_rate` parameters cannot be specified together with `scale` or
`out_length`.)",
nullptr, true)
.AddOptionalArg<float>("out_rate", R"(Output sampling rate.
The requested output sampling rate. This parameter must be specified together with ``in_rate``.
The value is relative to ``in_rate`` and doesn't need to use any specific unit as long as the
The requested output sampling rate. This parameter must be specified together with `in_rate`.
The value is relative to `in_rate` and doesn't need to use any specific unit as long as the
units of input and output rates match.
The ``in_rate`` and ``out_rate`` parameters cannot be specified together with ``scale`` or
``out_length``.)",
The `in_rate` and `out_rate` parameters cannot be specified together with `scale` or
`out_length`.)",
nullptr, true)
.AddOptionalArg<float>("scale", R"(The scaling factor.
The scaling factor is the ratio of the target sampling rate to source sampling rate. For example,
a ``scale=2`` will produce an output with twice as many samples as the input.
This parameter cannot be specified together with ``in_rate`` and ``out_rate`` or ``out_length``.)",
This parameter cannot be specified together with `in_rate` and `out_rate` or `out_length`.)",
nullptr, true)
.AddOptionalArg<int64_t>("out_length", R"(The requested output length, in samples.
The scaling factor is the ratio of this output length to the input length. This parameter
cannot be specified together with ``in_rate``, ``out_rate`` or ``scale``.)",
cannot be specified together with `in_rate`, `out_rate` or `scale`.)",
nullptr, true)
.AddOptionalArg("quality", R"(Resampling quality, where 0 is the lowest, and 100 is
the highest.
Expand Down
2 changes: 1 addition & 1 deletion dali/operators/bbox/bb_flip.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright (c) 2017-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion dali/operators/bbox/bbox_paste.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright (c) 2017-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions dali/operators/decoder/cache/cached_decoder_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ DALI_SCHEMA(CachedDecoderAttr)
R"code(Applies **only** to the ``mixed`` backend type.
Total size of the decoder cache in megabytes. When provided, the decoded images
that are larger than ``cache_threshold`` will be cached in GPU memory.
that are larger than `cache_threshold` will be cached in GPU memory.
)code",
0)
.AddOptionalArg("cache_threshold",
Expand All @@ -125,7 +125,7 @@ copied with ``cudaMemcpy``.)code",
Here is a list of the available cache types:
* | ``threshold``: caches every image with a size that is larger than ``cache_threshold`` until
* | ``threshold``: caches every image with a size that is larger than `cache_threshold` until
| the cache is full.
The warm-up time for threshold policy is 1 epoch.
Expand Down
44 changes: 22 additions & 22 deletions dali/operators/decoder/image_decoder.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2019-2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright (c) 2019-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -50,7 +50,7 @@ reallocated to decode the image.
If a value greater than 0 is provided, the operator preallocates one device buffer of the
requested size per thread. If the value is correctly selected, no additional allocations
will occur during the pipeline execution. One way to find the ideal value is to do a complete
run over the dataset with the ``memory_stats`` argument set to True and then copy the largest
run over the dataset with the `memory_stats` argument set to True and then copy the largest
allocation value that was printed in the statistics.)code",
16*1024*1024)
.AddOptionalArg("device_memory_padding_jpeg2k",
Expand All @@ -63,7 +63,7 @@ reallocated to decode the image.
If a value greater than 0 is provided, the operator preallocates the necessary number of buffers
according to the hint provided. If the value is correctly selected, no additional allocations
will occur during the pipeline execution. One way to find the ideal value is to do a complete
run over the dataset with the ``memory_stats`` argument set to True and then copy the largest
run over the dataset with the `memory_stats` argument set to True and then copy the largest
allocation value that was printed in the statistics.)code",
0)
.AddOptionalArg("host_memory_padding",
Expand All @@ -76,7 +76,7 @@ to be reallocated to decode the image.
If a value greater than 0 is provided, the operator preallocates two (because of double-buffering)
host-pinned buffers of the requested size per thread. If selected correctly, no additional
allocations will occur during the pipeline execution. One way to find the ideal value is to
do a complete run over the dataset with the ``memory_stats`` argument set to True, and then copy
do a complete run over the dataset with the `memory_stats` argument set to True, and then copy
the largest allocation value that is printed in the statistics.)code",
8*1024*1024) // based on ImageNet heuristics (8MB)
.AddOptionalArg("host_memory_padding_jpeg2k",
Expand All @@ -89,7 +89,7 @@ to be reallocated to decode the image.
If a value greater than 0 is provided, the operator preallocates the necessary number of buffers
according to the hint provided. If the value is correctly selected, no additional
allocations will occur during the pipeline execution. One way to find the ideal value is to
do a complete run over the dataset with the ``memory_stats`` argument set to True, and then copy
do a complete run over the dataset with the `memory_stats` argument set to True, and then copy
the largest allocation value that is printed in the statistics.)code",
0)
.AddOptionalArg("hw_decoder_load",
Expand Down Expand Up @@ -137,7 +137,7 @@ them at runtime.)code",
false)
.DeprecateArg("use_chunk_allocator") // deprecated in DALI 1.0
.AddOptionalArg("use_fast_idct",
R"code(Enables fast IDCT in the libjpeg-turbo based CPU decoder, used when ``device`` is set
R"code(Enables fast IDCT in the libjpeg-turbo based CPU decoder, used when `device` is set
to "cpu" or when the it is set to "mixed" but the particular image can not be handled by
the GPU implementation.
Expand All @@ -154,8 +154,8 @@ ImageMagick.)code",
R"code(Applies **only** to the ``mixed`` backend type.
Prints debug information about nvJPEG allocations. The information about the largest
allocation might be useful to determine suitable values for ``device_memory_padding`` and
``host_memory_padding`` for a dataset.
allocation might be useful to determine suitable values for `device_memory_padding` and
`host_memory_padding` for a dataset.
.. note::
The statistics are global for the entire process, not per operator instance, and include
Expand Down Expand Up @@ -210,7 +210,7 @@ Supported formats: JPG, BMP, PNG, TIFF, PNM, PPM, PGM, PBM, JPEG 2000, WebP.
.. note::
JPEG 2000 region-of-interest (ROI) decoding is not accelerated on the GPU, and will use
a CPU implementation regardless of the selected backend. For a GPU accelerated implementation,
consider using separate ``decoders.image`` and ``crop`` operators.
consider using separate ``decoders.image`` and `crop` operators.
.. note::
EXIF orientation metadata is disregarded.)code")
Expand All @@ -223,7 +223,7 @@ DALI_SCHEMA(decoders__ImageRandomCrop)
.DocStr(R"code(Decodes images and randomly crops them.
The cropping window's area (relative to the entire image) and aspect ratio can be restricted to
a range of values specified by ``area`` and ``aspect_ratio`` arguments, respectively.
a range of values specified by ``area`` and `aspect_ratio` arguments. respectively.
When possible, the operator uses the ROI decoding APIs (for example, *libjpeg-turbo* and *nvJPEG*)
to reduce the decoding time and memory usage. When the ROI decoding is not supported for a given
Expand Down Expand Up @@ -254,23 +254,23 @@ and shape of the slice. Both coordinates and shapes can be provided in absolute
The slice arguments can be specified by the following named arguments:
#. ``start``: Slice start coordinates (absolute)
#. ``rel_start``: Slice start coordinates (relative)
#. ``end``: Slice end coordinates (absolute)
#. ``rel_end``: Slice end coordinates (relative)
#. ``shape``: Slice shape (absolute)
#. ``rel_shape``: Slice shape (relative)
#. `start`: Slice start coordinates (absolute)
#. `rel_start`: Slice start coordinates (relative)
#. `end`: Slice end coordinates (absolute)
#. `rel_end`: Slice end coordinates (relative)
#. `shape`: Slice shape (absolute)
#. `rel_shape`: Slice shape (relative)
The slice can be configured by providing start and end coordinates or start and shape.
Relative and absolute arguments can be mixed (for example, ``rel_start`` can be used with ``shape``)
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``.
When using positional inputs, two extra boolean arguments ``normalized_anchor``/``normalized_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.
The slice arguments should provide as many dimensions as specified by the ``axis_names`` or ``axes``
The slice arguments should provide as many dimensions as specified by the `axis_names` or `axes`
arguments.
By default, the :meth:`nvidia.dali.fn.decoders.image_slice` operator uses normalized coordinates
Expand Down Expand Up @@ -302,14 +302,14 @@ point of the slice (x0, x1, x2, …).
Integer coordinates are interpreted as absolute coordinates, while float coordinates can be
interpreted as absolute or relative coordinates, depending on the value of
``normalized_anchor``.)code")
`normalized_anchor`.)code")
.InputDox(2, "shape", "1D TensorList of float or int",
R"code(Input that contains normalized or absolute coordinates for the dimensions
of the slice (s0, s1, s2, …).
Integer coordinates are interpreted as absolute coordinates, while float coordinates can be
interpreted as absolute or relative coordinates, depending on the value of
``normalized_shape``.)code");
`normalized_shape`.)code");


// Deprecated aliases
Expand Down
18 changes: 9 additions & 9 deletions dali/operators/decoder/inflate/inflate.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -21,16 +21,16 @@ namespace dali {
DALI_SCHEMA(experimental__Inflate)
.DocStr(R"code(Inflates/decompresses the input using specified decompression algorithm.
The input must be a 1D tensor of bytes (uint8). Passing the ``shape`` and ``dtype`` of the
The input must be a 1D tensor of bytes (uint8). Passing the `shape` and `dtype` of the
decompressed samples is required.
Each input sample can either be a single compressed chunk or consist of multiple
compressed chunks that have the same shape and type when inflated, so that they can be
be merged into a single tensor where the outermost extent of the tensor corresponds
to the number of the chunks.
If the sample is comprised of multiple chunks, the ``chunk_offsets`` or ``chunk_sizes``
must be specified. In that case, the ``shape`` must describe the shape of a single inflated
If the sample is comprised of multiple chunks, the `chunk_offsets` or `chunk_sizes`
must be specified. In that case, the `shape` must describe the shape of a single inflated
(output) chunk. The number of the chunks will automatically be added as the outermost extent
to the output tensors.
Expand Down Expand Up @@ -58,13 +58,13 @@ concatenating compressed frames from the corresponding sequences.::
R"code(A list of offsets within the input sample
describing where the consecutive chunks begin.
If the ``chunk_sizes`` is not specified, it is assumed that the chunks are densely packed
If the `chunk_sizes` is not specified, it is assumed that the chunks are densely packed
in the input tensor and the last chunk ends with the sample's end.)code",
nullptr, true)
.AddOptionalArg<std::vector<int>>(inflate::sizeArgName,
R"code(A list of sizes of corresponding input chunks.
If the ``chunk_offsets`` is not specified, it is assumed that the chunks are densely packed
If the `chunk_offsets` is not specified, it is assumed that the chunks are densely packed
in the input tensor and the first chunk starts at the beginning of the sample.)code",
nullptr, true)
.AddOptionalArg(inflate::algArgName, R"code(Algorithm to be used to decode the data.
Expand All @@ -74,16 +74,16 @@ Currently only ``LZ4`` is supported.)code",
.AddOptionalArg(inflate::layoutArgName,
R"code(Layout of the output (inflated) chunk.
If the samples consist of multiple chunks, additionally, the ``sequence_axis_name`` extent
If the samples consist of multiple chunks, additionally, the `sequence_axis_name` extent
will be added to the beginning of the specified layout.)code",
TensorLayout(""))
.AddOptionalArg(inflate::sequenceLayoutArgName, R"code(The name for the sequence axis.
If the samples consist of multiple chunks, an extra outer dimension will be added to
the output tensor. By default, it is assumed to be video frames, hence the default label 'F'
The value is ignored if the ``layout`` is not specified or the input is not a sequence
( neither ``chunk_offsets`` nor ``chunk_sizes`` is specified).
The value is ignored if the `layout` is not specified or the input is not a sequence
( neither `chunk_offsets` nor `chunk_sizes` is specified).
)code",
TensorLayout("F"));

Expand Down
14 changes: 7 additions & 7 deletions dali/operators/generic/constant.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright (c) 2020-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -25,9 +25,9 @@ namespace dali {
DALI_SCHEMA(Constant)
.DocStr(R"code(Produces a batch of constant tensors.
The floating point input data should be placed in the ``fdata`` argument
and integer data in ``idata``. The data, which can be a flat vector of values or a scalar,
is then reshaped according to the ``shape`` argument. If the data is scalar, it will be broadcast
The floating point input data should be placed in the `fdata` argument
and integer data in `idata`. The data, which can be a flat vector of values or a scalar,
is then reshaped according to the `shape` argument. If the data is scalar, it will be broadcast
to fill the entire shape.
The operator only performs meaningful work at first invocation; subsequent calls will return
Expand All @@ -36,7 +36,7 @@ a reference to the same memory.
The operator can be automatically instantiated in Python with a call to
:func:`types.Constant(value, dtype, shape, layout) <nvidia.dali.types.Constant>`.
The value can be a scalar, a tuple, a list, or a numpy array. If not explicitly overridden,
the ``shape`` and ``dtype``, will be taken from the array.
the `shape` and `dtype`, will be taken from the array.
.. warning::
64-bit integer and double precision arrays are not supported and will be silently
Expand All @@ -51,13 +51,13 @@ the ``shape`` and ``dtype``, will be taken from the array.
R"code(Contents of the constant that is produced (for floating point types).
.. note::
``fdata`` and ``idata`` are mutually exclusive, and one of them is required.)code",
`fdata` and `idata` are mutually exclusive, and one of them is required.)code",
std::vector<float>())
.AddOptionalArg("idata",
R"code(Contents of the constant that is produced (for integer point types).
.. note::
``fdata`` and ``idata`` are mutually exclusive, and one of them is required.)code",
`fdata` and `idata` are mutually exclusive, and one of them is required.)code",
std::vector<int>())
.AddOptionalTypeArg("dtype", R"code(Output data type.
Expand Down
Loading

0 comments on commit c4f280c

Please sign in to comment.