Skip to content

Commit

Permalink
Improve documentation of ExternalSource and RandomResizedCrop (#815)
Browse files Browse the repository at this point in the history
Signed-off-by: Joaquin Anton <janton@nvidia.com>
  • Loading branch information
jantonguirao authored and JanuszL committed Apr 24, 2019
1 parent 0d307ca commit 01d024a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion dali/pipeline/operators/resize/random_resized_crop.cc
Expand Up @@ -24,7 +24,8 @@ namespace dali {

DALI_SCHEMA(RandomResizedCrop)
.DocStr("Perform a crop with randomly chosen area and aspect ratio,"
" then resize it to given size.")
" then resize it to given size. Expects a 3-dimensional input with samples"
" in HWC layout (height, width, channels)")
.NumInput(1)
.NumOutput(1)
.AllowMultipleInputSets()
Expand Down
6 changes: 4 additions & 2 deletions dali/pipeline/operators/util/external_source.cc
Expand Up @@ -45,8 +45,10 @@ DALI_REGISTER_OPERATOR(ExternalSource, ExternalSource<CPUBackend>, CPU);
DALI_SCHEMA(ExternalSource)
.DocStr(R"code(Allows externally provided data to be passed as an input to the pipeline,
see :meth:`nvidia.dali.pipeline.Pipeline.feed_input` and
:meth:`nvidia.dali.pipeline.Pipeline.iter_setup`. Currenlty this operator is not
supported in TensorFlow.)code")
:meth:`nvidia.dali.pipeline.Pipeline.iter_setup`. Currently this operator is not
supported in TensorFlow. It is worth noting that fed inputs should match the number of dimensions
expected by the next operator in the pipeline (e.g. NHWC will expect 3-dimensional tensors
where the last dimension represents the different channels).)code")
.NumInput(0)
.NumOutput(1);

Expand Down
3 changes: 2 additions & 1 deletion dali/python/nvidia/dali/pipeline.py
Expand Up @@ -232,7 +232,8 @@ def build(self):

def feed_input(self, ref, data):
"""Bind the NumPy array to a tensor produced by ExternalSource
operator."""
operator. It is worth mentioning that `ref` should not be overriden
with other operator outputs."""
if not self._built:
raise RuntimeError("Pipeline must be built first.")
if not isinstance(ref, Edge.EdgeReference):
Expand Down

0 comments on commit 01d024a

Please sign in to comment.