See TensorArray.
(self, value, lengths, name=None)
| 595 | |
| 596 | @tf_should_use.should_use_result |
| 597 | def split(self, value, lengths, name=None): |
| 598 | """See TensorArray.""" |
| 599 | with ops.name_scope(name, "TensorArraySplit", [self._flow, value, lengths]): |
| 600 | # TODO(b/129870929): Fix after all callers provide proper init dtype. |
| 601 | value = ops.convert_to_tensor( |
| 602 | value, preferred_dtype=self._dtype, name="value") |
| 603 | _check_dtypes(value, self._dtype) |
| 604 | lengths_64 = math_ops.cast(lengths, dtypes.int64) |
| 605 | if not context.executing_eagerly(): |
| 606 | clengths = tensor_util.constant_value(lengths_64) |
| 607 | if value.shape.dims is not None and clengths is not None: |
| 608 | if clengths.shape and clengths.max() == clengths.min(): |
| 609 | self._check_element_shape( |
| 610 | tensor_shape.TensorShape([clengths[0]]).concatenate( |
| 611 | value.shape[1:])) |
| 612 | flow_out = list_ops.tensor_list_split( |
| 613 | tensor=value, |
| 614 | lengths=lengths_64, |
| 615 | element_shape=self.element_shape, |
| 616 | name=name) |
| 617 | return build_ta_with_new_flow(self, flow_out) |
| 618 | |
| 619 | def size(self, name=None): |
| 620 | """See TensorArray.""" |
nothing calls this directly
no test coverage detected