(batch_size, pipe_type, label_type)
| 120 | |
| 121 | |
| 122 | def get_batch_dali_sparse(batch_size, pipe_type, label_type): |
| 123 | pipe = pipe_type(batch_size=batch_size, num_threads=2, device_id=None, num_gpus=1) |
| 124 | |
| 125 | daliop = dali_tf.DALIIterator() |
| 126 | with tf.device("/cpu"): |
| 127 | image, label = daliop( |
| 128 | pipeline=pipe, |
| 129 | shapes=[(batch_size, 3, 227, 227), ()], |
| 130 | dtypes=[tf.int32, label_type], |
| 131 | device_id=None, |
| 132 | sparse=[False, True], |
| 133 | ) |
| 134 | |
| 135 | return image, label |
| 136 | |
| 137 | |
| 138 | def test_dali_tf_op_sparse(pipe_type=CaffeReadPipeline, batch_size=16, iterations=32): |
no test coverage detected