(max_batch_size, input_data, device)
| 1590 | |
| 1591 | def test_conditional(): |
| 1592 | def conditional_wrapper(max_batch_size, input_data, device): |
| 1593 | @experimental_pipeline_def( |
| 1594 | enable_conditionals=True, |
| 1595 | batch_size=max_batch_size, |
| 1596 | num_threads=4, |
| 1597 | device_id=0, |
| 1598 | ) |
| 1599 | def actual_pipe(): |
| 1600 | variable_condition = fn.external_source(source=input_data, cycle=False, device=device) |
| 1601 | variable_data = variable_condition + 42.0 |
| 1602 | if variable_condition: |
| 1603 | other_variable_data = variable_condition + 100 |
| 1604 | output = variable_data + other_variable_data |
| 1605 | else: |
| 1606 | output = types.Constant(np.array(42.0), device="cpu") |
| 1607 | logical_expr = variable_condition or not variable_condition |
| 1608 | logical_expr2 = not variable_condition and variable_condition |
| 1609 | return ( |
| 1610 | output, |
| 1611 | variable_condition, |
| 1612 | variable_data, |
| 1613 | logical_expr, |
| 1614 | logical_expr2, |
| 1615 | ) |
| 1616 | |
| 1617 | return actual_pipe() |
| 1618 | |
| 1619 | check_pipeline( |
| 1620 | generate_data(31, 13, custom_shape_generator(), lo=False, hi=True, dtype=np.bool_), |
nothing calls this directly
no test coverage detected