当前位置: 首页>>代码示例>>Python>>正文


Python array_ops.broadcast_dynamic_shape方法代码示例

本文整理汇总了Python中tensorflow.python.ops.array_ops.broadcast_dynamic_shape方法的典型用法代码示例。如果您正苦于以下问题:Python array_ops.broadcast_dynamic_shape方法的具体用法?Python array_ops.broadcast_dynamic_shape怎么用?Python array_ops.broadcast_dynamic_shape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tensorflow.python.ops.array_ops的用法示例。


在下文中一共展示了array_ops.broadcast_dynamic_shape方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: prefer_static_broadcast_shape

# 需要导入模块: from tensorflow.python.ops import array_ops [as 别名]
# 或者: from tensorflow.python.ops.array_ops import broadcast_dynamic_shape [as 别名]
def prefer_static_broadcast_shape(
    shape1, shape2, name="prefer_static_broadcast_shape"):
  """Convenience function which statically broadcasts shape when possible.

  Args:
    shape1:  `1-D` integer `Tensor`.  Already converted to tensor!
    shape2:  `1-D` integer `Tensor`.  Already converted to tensor!
    name:  A string name to prepend to created ops.

  Returns:
    The broadcast shape, either as `TensorShape` (if broadcast can be done
      statically), or as a `Tensor`.
  """
  with ops.name_scope(name, values=[shape1, shape2]):
    if (tensor_util.constant_value(shape1) is not None and
        tensor_util.constant_value(shape2) is not None):
      return array_ops.broadcast_static_shape(
          tensor_shape.TensorShape(tensor_util.constant_value(shape1)),
          tensor_shape.TensorShape(tensor_util.constant_value(shape2)))
    return array_ops.broadcast_dynamic_shape(shape1, shape2) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:22,代码来源:distribution_util.py

示例2: _batch_shape_tensor

# 需要导入模块: from tensorflow.python.ops import array_ops [as 别名]
# 或者: from tensorflow.python.ops.array_ops import broadcast_dynamic_shape [as 别名]
def _batch_shape_tensor(self):
    return array_ops.broadcast_dynamic_shape(
        array_ops.shape(self.concentration),
        array_ops.shape(self.rate)) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:6,代码来源:gamma.py

示例3: _batch_shape_tensor

# 需要导入模块: from tensorflow.python.ops import array_ops [as 别名]
# 或者: from tensorflow.python.ops.array_ops import broadcast_dynamic_shape [as 别名]
def _batch_shape_tensor(self):
    return array_ops.broadcast_dynamic_shape(
        array_ops.shape(self.df),
        array_ops.broadcast_dynamic_shape(
            array_ops.shape(self.loc), array_ops.shape(self.scale))) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:7,代码来源:student_t.py

示例4: _batch_shape_tensor

# 需要导入模块: from tensorflow.python.ops import array_ops [as 别名]
# 或者: from tensorflow.python.ops.array_ops import broadcast_dynamic_shape [as 别名]
def _batch_shape_tensor(self):
    return array_ops.broadcast_dynamic_shape(
        array_ops.shape(self.low),
        array_ops.shape(self.high)) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:6,代码来源:uniform.py

示例5: _cdf

# 需要导入模块: from tensorflow.python.ops import array_ops [as 别名]
# 或者: from tensorflow.python.ops.array_ops import broadcast_dynamic_shape [as 别名]
def _cdf(self, x):
    broadcast_shape = array_ops.broadcast_dynamic_shape(
        array_ops.shape(x), self.batch_shape_tensor())
    zeros = array_ops.zeros(broadcast_shape, dtype=self.dtype)
    ones = array_ops.ones(broadcast_shape, dtype=self.dtype)
    broadcasted_x = x * ones
    result_if_not_big = array_ops.where(
        x < self.low, zeros, (broadcasted_x - self.low) / self.range())
    return array_ops.where(x >= self.high, ones, result_if_not_big) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:11,代码来源:uniform.py

示例6: _batch_shape_tensor

# 需要导入模块: from tensorflow.python.ops import array_ops [as 别名]
# 或者: from tensorflow.python.ops.array_ops import broadcast_dynamic_shape [as 别名]
def _batch_shape_tensor(self):
    return array_ops.broadcast_dynamic_shape(
        array_ops.shape(self.loc), array_ops.shape(self.scale)) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:5,代码来源:laplace.py

示例7: _batch_shape_tensor

# 需要导入模块: from tensorflow.python.ops import array_ops [as 别名]
# 或者: from tensorflow.python.ops.array_ops import broadcast_dynamic_shape [as 别名]
def _batch_shape_tensor(self):
    return array_ops.broadcast_dynamic_shape(
        array_ops.shape(self.total_count),
        array_ops.shape(self.probs)) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:6,代码来源:binomial.py

示例8: _shape_tensor

# 需要导入模块: from tensorflow.python.ops import array_ops [as 别名]
# 或者: from tensorflow.python.ops.array_ops import broadcast_dynamic_shape [as 别名]
def _shape_tensor(self):
    batch_shape = array_ops.broadcast_dynamic_shape(
        self.base_operator.batch_shape_tensor(),
        array_ops.shape(self.u)[:-2])
    return array_ops.concat(
        [batch_shape, self.base_operator.shape_tensor()[-2:]], axis=0) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:8,代码来源:linear_operator_udvh_update.py

示例9: _batch_shape

# 需要导入模块: from tensorflow.python.ops import array_ops [as 别名]
# 或者: from tensorflow.python.ops.array_ops import broadcast_dynamic_shape [as 别名]
def _batch_shape(self):
    return array_ops.broadcast_dynamic_shape(
        array_ops.shape(self.alpha), array_ops.shape(self.beta)) 
开发者ID:abhisuri97,项目名称:auto-alt-text-lambda-api,代码行数:5,代码来源:gamma.py

示例10: _batch_shape

# 需要导入模块: from tensorflow.python.ops import array_ops [as 别名]
# 或者: from tensorflow.python.ops.array_ops import broadcast_dynamic_shape [as 别名]
def _batch_shape(self):
    return array_ops.broadcast_dynamic_shape(
        array_ops.shape(self.loc), array_ops.shape(self.scale)) 
开发者ID:abhisuri97,项目名称:auto-alt-text-lambda-api,代码行数:5,代码来源:logistic.py

示例11: _batch_shape

# 需要导入模块: from tensorflow.python.ops import array_ops [as 别名]
# 或者: from tensorflow.python.ops.array_ops import broadcast_dynamic_shape [as 别名]
def _batch_shape(self):
    return array_ops.broadcast_dynamic_shape(
        array_ops.shape(self.df),
        array_ops.broadcast_dynamic_shape(
            array_ops.shape(self.mu), array_ops.shape(self.sigma))) 
开发者ID:abhisuri97,项目名称:auto-alt-text-lambda-api,代码行数:7,代码来源:student_t.py

示例12: _batch_shape

# 需要导入模块: from tensorflow.python.ops import array_ops [as 别名]
# 或者: from tensorflow.python.ops.array_ops import broadcast_dynamic_shape [as 别名]
def _batch_shape(self):
    return array_ops.broadcast_dynamic_shape(
        array_ops.shape(self.n), array_ops.shape(self.p)) 
开发者ID:abhisuri97,项目名称:auto-alt-text-lambda-api,代码行数:5,代码来源:binomial.py

示例13: _batch_shape

# 需要导入模块: from tensorflow.python.ops import array_ops [as 别名]
# 或者: from tensorflow.python.ops.array_ops import broadcast_dynamic_shape [as 别名]
def _batch_shape(self):
    return array_ops.broadcast_dynamic_shape(
        array_ops.shape(self.mu), array_ops.shape(self.sigma)) 
开发者ID:abhisuri97,项目名称:auto-alt-text-lambda-api,代码行数:5,代码来源:normal.py

示例14: _batch_shape_tensor

# 需要导入模块: from tensorflow.python.ops import array_ops [as 别名]
# 或者: from tensorflow.python.ops.array_ops import broadcast_dynamic_shape [as 别名]
def _batch_shape_tensor(self):
        return array_ops.broadcast_dynamic_shape(
            array_ops.shape(self._loc),
            array_ops.shape(self._scale)) 
开发者ID:nicola-decao,项目名称:s-vae-tf,代码行数:6,代码来源:von_mises_fisher.py


注:本文中的tensorflow.python.ops.array_ops.broadcast_dynamic_shape方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。