aesara.tensor.ones_like

Contents

aesara.tensor.ones_like#

aesara.tensor.ones_like(model, dtype=None, opt=False)[source]#

Equivalent of numpy.ones_like.

Parameters:
  • model

  • dtype

  • opt – If True, we will return a constant instead of a graph when possible. Useful for Aesara optimization, not for user building a graph as this have the consequence that model isn’t always in the graph.

Returns:

tensor the shape of model containing ones of the type of dtype.

Return type:

tensor