Reduces all input elements. Args: inputs: A list of ``tf.Tensor``. sequence_length: The length of each input, if reducing sequences. Returns: If :obj:`sequence_length` is set, a tuple ``(reduced_input, reduced_length)``, otherwise a reduced ``t
(self, inputs, sequence_length=None)
| 102 | return tf.nest.pack_sequence_as(x, reduced) |
| 103 | |
| 104 | def __call__(self, inputs, sequence_length=None): |
| 105 | """Reduces all input elements. |
| 106 | Args: |
| 107 | inputs: A list of ``tf.Tensor``. |
| 108 | sequence_length: The length of each input, if reducing sequences. |
| 109 | Returns: |
| 110 | If :obj:`sequence_length` is set, a tuple |
| 111 | ``(reduced_input, reduced_length)``, otherwise a reduced ``tf.Tensor`` |
| 112 | only. |
| 113 | """ |
| 114 | if sequence_length is None: |
| 115 | return self.reduce(inputs) |
| 116 | else: |
| 117 | return self.reduce_sequence(inputs, sequence_lengths=sequence_length) |
| 118 | |
| 119 | @abc.abstractmethod |
| 120 | def reduce(self, inputs): |
nothing calls this directly
no test coverage detected