MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / stack_inputs

Method stack_inputs

tensorflow/python/ops/parallel_for/pfor.py:683–696  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 15

_inputs_with_flatteningFunction · 0.80
_convert_searchsortedFunction · 0.80
_convert_matrix_set_diagFunction · 0.80
_convert_packFunction · 0.80
_convert_gatherFunction · 0.80
_convert_concatv2Function · 0.80
_convert_batch_mat_mulFunction · 0.80

Calls 2

_stackFunction · 0.85
rangeFunction · 0.50

Tested by

no test coverage detected