Update docs for validate arg in RaggedTensor factory methods to make it clear that validation comes with a runtime cost.

PiperOrigin-RevId: 297742298
Change-Id: Icacc54a6d1cf7341989424ca784191dfade43204
This commit is contained in:
Edward Loper 2020-02-27 18:49:23 -08:00 committed by TensorFlower Gardener
parent 7dbff51a35
commit 3be1f72f52

View File

@ -341,7 +341,8 @@ class RaggedTensor(composite_tensor.CompositeTensor):
Defaults to `value_rowids[-1]` (or zero if `value_rowids` is empty).
name: A name prefix for the RaggedTensor (optional).
validate: If true, then use assertions to check that the arguments form
a valid `RaggedTensor`.
a valid `RaggedTensor`. Note: these assertions incur a runtime cost,
since they must be checked for each tensor value.
Returns:
A `RaggedTensor`. `result.rank = values.rank + 1`.
@ -450,7 +451,8 @@ class RaggedTensor(composite_tensor.CompositeTensor):
zero and `row_splits[-1]` must be `nvals`.
name: A name prefix for the RaggedTensor (optional).
validate: If true, then use assertions to check that the arguments form
a valid `RaggedTensor`.
a valid `RaggedTensor`. Note: these assertions incur a runtime cost,
since they must be checked for each tensor value.
Returns:
A `RaggedTensor`. `result.rank = values.rank + 1`.
@ -511,7 +513,8 @@ class RaggedTensor(composite_tensor.CompositeTensor):
nonnegative. `sum(row_lengths)` must be `nvals`.
name: A name prefix for the RaggedTensor (optional).
validate: If true, then use assertions to check that the arguments form
a valid `RaggedTensor`.
a valid `RaggedTensor`. Note: these assertions incur a runtime cost,
since they must be checked for each tensor value.
Returns:
A `RaggedTensor`. `result.rank = values.rank + 1`.
@ -566,7 +569,8 @@ class RaggedTensor(composite_tensor.CompositeTensor):
`row_starts[0]` must be zero.
name: A name prefix for the RaggedTensor (optional).
validate: If true, then use assertions to check that the arguments form
a valid `RaggedTensor`.
a valid `RaggedTensor`. Note: these assertions incur a runtime cost,
since they must be checked for each tensor value.
Returns:
A `RaggedTensor`. `result.rank = values.rank + 1`.
@ -615,7 +619,8 @@ class RaggedTensor(composite_tensor.CompositeTensor):
ascending order. If `nrows>0`, then `row_limits[-1]` must be `nvals`.
name: A name prefix for the RaggedTensor (optional).
validate: If true, then use assertions to check that the arguments form
a valid `RaggedTensor`.
a valid `RaggedTensor`. Note: these assertions incur a runtime cost,
since they must be checked for each tensor value.
Returns:
A `RaggedTensor`. `result.rank = values.rank + 1`.
@ -695,7 +700,8 @@ class RaggedTensor(composite_tensor.CompositeTensor):
`uniform_row_length` might be zero. `uniform_row_length*nrows` must
be `nvals`.
validate: If true, then use assertions to check that the arguments form
a valid `RaggedTensor`.
a valid `RaggedTensor`. Note: these assertions incur a runtime cost,
since they must be checked for each tensor value.
name: A name prefix for the RaggedTensor (optional).
Returns:
@ -819,7 +825,8 @@ class RaggedTensor(composite_tensor.CompositeTensor):
name: A name prefix for the RaggedTensor (optional).
validate: If true, then use assertions to check that the arguments form
a valid `RaggedTensor`.
a valid `RaggedTensor`. Note: these assertions incur a runtime cost,
since they must be checked for each tensor value.
Returns:
A `RaggedTensor` (or `flat_values` if `nested_value_rowids` is empty).
@ -871,8 +878,9 @@ class RaggedTensor(composite_tensor.CompositeTensor):
nested_row_splits: A list of 1-D integer tensors. The `i`th tensor is
used as the `row_splits` for the `i`th ragged dimension.
name: A name prefix for the RaggedTensor (optional).
validate: If true, then use assertions to check that the arguments form a
valid `RaggedTensor`.
validate: If true, then use assertions to check that the arguments form
a valid `RaggedTensor`. Note: these assertions incur a runtime cost,
since they must be checked for each tensor value.
Returns:
A `RaggedTensor` (or `flat_values` if `nested_row_splits` is empty).
@ -910,7 +918,8 @@ class RaggedTensor(composite_tensor.CompositeTensor):
used as the `row_lengths` for the `i`th ragged dimension.
name: A name prefix for the RaggedTensor (optional).
validate: If true, then use assertions to check that the arguments form
a valid `RaggedTensor`.
a valid `RaggedTensor`. Note: these assertions incur a runtime cost,
since they must be checked for each tensor value.
Returns:
A `RaggedTensor` (or `flat_values` if `nested_row_lengths` is empty).