Stacks unstacked inputs at `stack_indices`. Args: stack_indices: indices of inputs at which stacking is done. If None, stacking is done at all indices.
(self, stack_indices=None)
| 681 | self._inputs = inputs |
| 682 | |
| 683 | def stack_inputs(self, stack_indices=None): |
| 684 | """Stacks unstacked inputs at `stack_indices`. |
| 685 | |
| 686 | Args: |
| 687 | stack_indices: indices of inputs at which stacking is done. If None, |
| 688 | stacking is done at all indices. |
| 689 | """ |
| 690 | if stack_indices is None: |
| 691 | stack_indices = range(len(self._inputs)) |
| 692 | length = self.pfor.loop_len_vector |
| 693 | for i in stack_indices: |
| 694 | inp = self._inputs[i] |
| 695 | if not inp.is_stacked: |
| 696 | self._inputs[i] = _stack(inp.t, length) |
| 697 | |
| 698 | def expanddim_inputs_for_broadcast(self): |
| 699 | """Reshapes stacked inputs to prepare them for broadcast. |
no test coverage detected