用法
bounding_shape(
axis=None, name=None, out_type=None
)
參數
-
axis
一個整數標量或向量,指示要為其返回邊界框的軸。如果未指定,則返回完整的邊界框。 -
name
返回張量的名稱前綴(可選)。 -
out_type
dtype
用於返回的張量。默認為self.row_splits.dtype
。
返回
-
一個整數
Tensor
(dtype=self.row_splits.dtype
)。如果未指定axis
,則output
是帶有output.shape=[self.shape.ndims]
的向量。如果axis
是標量,則output
是標量。如果axis
是向量,則output
是向量,其中output[i]
是維度axis[i]
的邊界大小。
返回此 RaggedTensor
的緊密邊界框形狀。
例子:
rt = tf.ragged.constant([[1, 2, 3, 4], [5], [], [6, 7, 8, 9], [10]])
rt.bounding_shape().numpy()
array([5, 4])
相關用法
- Python tf.RaggedTensor.row_lengths用法及代碼示例
- Python tf.RaggedTensor.__rmul__用法及代碼示例
- Python tf.RaggedTensor.from_uniform_row_length用法及代碼示例
- 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__用法及代碼示例
- Python tf.RaggedTensor.__rpow__用法及代碼示例
- Python tf.RaggedTensor.row_limits用法及代碼示例
- Python tf.RaggedTensor.nested_value_rowids用法及代碼示例
- Python tf.RaggedTensor.__rxor__用法及代碼示例
- Python tf.RaggedTensor.from_value_rowids用法及代碼示例
- Python tf.RaggedTensor.from_nested_row_lengths用法及代碼示例
- Python tf.RaggedTensor.__ror__用法及代碼示例
- Python tf.RaggedTensor.__rsub__用法及代碼示例
- Python tf.RaggedTensor.__abs__用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.RaggedTensor.bounding_shape。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。