pymc.math.ones_like#

pymc.math.ones_like(model, dtype=None, opt=False)[source]#

equivalent of numpy.ones_like Parameters ———- model : tensor dtype : data-type, optional opt : If True, we will return a constant instead of a graph when possible.

Useful for PyTensor optimization, not for user building a graph as this have the consequence that model isn’t always in the graph.

Returns:
tensor

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