Skip to content

Commit 6c4549d

Browse files
authored
Fix in TL1_cutom_src_pattern_build test (#6103)
- nvtx is required to generate stubs for dynamic mode. Stubs are generated when DALI is installed what happens in TL1_cutom_src_pattern_build test - adds defensive check for dynamic.readers before accessing it to prevent AttributeError when dynamic module doesn't have readers attribute Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> --------- Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
1 parent e1b8f7b commit 6c4549d

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

dali/python/nvidia/dali/ops/_signatures.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,10 @@ def _try_extend_reader_signature(schema: _b.OpSchema, op_name: str):
760760

761761
from nvidia.dali.experimental import dynamic
762762

763-
op = getattr(dynamic.readers, op_name, None)
763+
readers = getattr(dynamic, "readers", None)
764+
if readers is None:
765+
return ""
766+
op = getattr(readers, op_name, None)
764767
if op is None or not issubclass(op, dynamic.ops.Reader):
765768
return ""
766769

qa/TL1_custom_src_pattern_build/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash -e
22

3-
pip_packages='astunparse gast dm-tree black'
3+
pip_packages='astunparse gast dm-tree black nvtx makefun'
44

55
build_and_check() {
66
make -j

0 commit comments

Comments
 (0)