(pfor_input)
| 2563 | @RegisterPFor("RandomGamma") |
| 2564 | @RegisterPFor("RandomPoissonV2") |
| 2565 | def _convert_random_with_param(pfor_input): |
| 2566 | shape = pfor_input.unstacked_input(0) |
| 2567 | # param is lam (Poisson rate) or alpha (Gamma shape). |
| 2568 | param, param_stacked, _ = pfor_input.input(1) |
| 2569 | logging.warning( |
| 2570 | "Note that %s inside pfor op may not give same output as " |
| 2571 | "inside a sequential loop.", pfor_input.op_type) |
| 2572 | |
| 2573 | if param_stacked: |
| 2574 | samples = _create_op( |
| 2575 | pfor_input.op_type, |
| 2576 | inputs=[shape, param], |
| 2577 | op_dtypes=[x.dtype for x in pfor_input.outputs], |
| 2578 | attrs=pfor_input.op.node_def.attr).outputs[0] |
| 2579 | loop_dim = array_ops.shape(shape)[0] |
| 2580 | stacked_samples = _transpose_dim_to_front(samples, loop_dim) |
| 2581 | else: |
| 2582 | shape = array_ops.concat([pfor_input.pfor.loop_len_vector, shape], axis=0) |
| 2583 | stacked_samples = _create_op( |
| 2584 | pfor_input.op_type, |
| 2585 | inputs=[shape, param], |
| 2586 | op_dtypes=[x.dtype for x in pfor_input.outputs], |
| 2587 | attrs=pfor_input.op.node_def.attr).outputs[0] |
| 2588 | |
| 2589 | return wrap(stacked_samples, True) |
| 2590 | |
| 2591 | |
| 2592 | @RegisterPFor("Multinomial") |
nothing calls this directly
no test coverage detected