用法
@classmethod
from_nested_value_rowids(
flat_values, nested_value_rowids, nested_nrows=None, name=None, validate=True
)參數
-
flat_values一個可能參差不齊的張量。 -
nested_value_rowids一維整數張量列表。ith 張量用作ith ragged 維度的value_rowids。 -
nested_nrows整數標量列表。ith 標量用作ith ragged 維度的nrows。 -
nameRaggedTensor 的名稱前綴(可選)。 -
validate如果為真,則使用斷言檢查參數是否形成有效的RaggedTensor。注意:這些斷言會產生運行時成本,因為必須檢查每個張量值。
返回
-
一個
RaggedTensor(或flat_values,如果nested_value_rowids為空)。
拋出
-
ValueError如果len(nested_values_rowids) != len(nested_nrows)。
從 value_rowids 張量的嵌套列表創建 RaggedTensor。
相當於:
result = flat_values
for (rowids, nrows) in reversed(zip(nested_value_rowids, nested_nrows)):
result = from_value_rowids(result, rowids, nrows)
相關用法
- Python tf.RaggedTensor.from_nested_row_lengths用法及代碼示例
- Python tf.RaggedTensor.from_nested_row_splits用法及代碼示例
- Python tf.RaggedTensor.from_uniform_row_length用法及代碼示例
- Python tf.RaggedTensor.from_value_rowids用法及代碼示例
- Python tf.RaggedTensor.from_tensor用法及代碼示例
- Python tf.RaggedTensor.from_row_limits用法及代碼示例
- Python tf.RaggedTensor.from_sparse用法及代碼示例
- Python tf.RaggedTensor.from_row_splits用法及代碼示例
- Python tf.RaggedTensor.from_row_starts用法及代碼示例
- Python tf.RaggedTensor.from_row_lengths用法及代碼示例
- Python tf.RaggedTensor.row_lengths用法及代碼示例
- Python tf.RaggedTensor.__rmul__用法及代碼示例
- Python tf.RaggedTensor.__radd__用法及代碼示例
- Python tf.RaggedTensor.__pow__用法及代碼示例
- Python tf.RaggedTensor.__rand__用法及代碼示例
- Python tf.RaggedTensor.numpy用法及代碼示例
- Python tf.RaggedTensor.get_shape用法及代碼示例
- Python tf.RaggedTensor.__xor__用法及代碼示例
- Python tf.RaggedTensor.__gt__用法及代碼示例
- Python tf.RaggedTensor.__getitem__用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.RaggedTensor.from_nested_value_rowids。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
