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

Method split

tensorflow/python/ops/tensor_array_ops.py:597–617  ·  view source on GitHub ↗

See TensorArray.

(self, value, lengths, name=None)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 9

_check_element_shapeMethod · 0.95
_check_dtypesFunction · 0.85
build_ta_with_new_flowFunction · 0.85
executing_eagerlyMethod · 0.80
name_scopeMethod · 0.45
castMethod · 0.45
maxMethod · 0.45
minMethod · 0.45
concatenateMethod · 0.45

Tested by

no test coverage detected