當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python tf.compat.v1.Dimension.merge_with用法及代碼示例

用法

merge_with(
    other
)

參數

  • other 另一個維度。

返回

  • 一個 Dimension 包含 selfother 的組合信息。

拋出

  • ValueError 如果selfother 不兼容(參見is_compatible_with)。

返回結合 selfother 中的信息的維度。

尺寸組合如下:

tf.compat.v1.Dimension(n)   .merge_with(tf.compat.v1.Dimension(n))     ==
tf.compat.v1.Dimension(n)
tf.compat.v1.Dimension(n)   .merge_with(tf.compat.v1.Dimension(None))  ==
tf.compat.v1.Dimension(n)
tf.compat.v1.Dimension(None).merge_with(tf.compat.v1.Dimension(n))     ==
tf.compat.v1.Dimension(n)
# equivalent to tf.compat.v1.Dimension(None)
tf.compat.v1.Dimension(None).merge_with(tf.compat.v1.Dimension(None))

# raises ValueError for n != m
tf.compat.v1.Dimension(n)   .merge_with(tf.compat.v1.Dimension(m))

相關用法


注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.compat.v1.Dimension.merge_with。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。