(input_data: ArgData, param_cb, rng, check_broadcasting)
| 325 | |
| 326 | |
| 327 | def get_input_arg_per_frame(input_data: ArgData, param_cb, rng, check_broadcasting): |
| 328 | frame_idx = input_data.desc.expandable_prefix.find("F") |
| 329 | assert frame_idx >= 0 |
| 330 | |
| 331 | def arg_for_sample(sample_idx, batch_idx, sample): |
| 332 | if check_broadcasting and rng.randint(1, 4) == 1: |
| 333 | return np.array([param_cb(SampleDesc(rng, 0, sample_idx, batch_idx, sample))]) |
| 334 | num_frames = sample.shape[frame_idx] |
| 335 | return np.array( |
| 336 | [ |
| 337 | param_cb(SampleDesc(rng, frame_idx, sample_idx, batch_idx, sample)) |
| 338 | for frame_idx in range(num_frames) |
| 339 | ] |
| 340 | ) |
| 341 | |
| 342 | return [ |
| 343 | [arg_for_sample(sample_idx, batch_idx, sample) for sample_idx, sample in enumerate(batch)] |
| 344 | for batch_idx, batch in enumerate(input_data.data) |
| 345 | ] |
| 346 | |
| 347 | |
| 348 | def compute_input_params_data(input_data: ArgData, rng, input_params: List[ArgCb]): |
no test coverage detected