pymoose.ones
pymoose.ones#
- pymoose.ones(shape, dtype, placement=None)[source]#
Embed a ones array into the Moose computation graph.
Equivalent to pm.constant(np.ones(shape, dtype)) for a given
dtypeandshape.- Parameters
shape – Shape of the ones array.
dtype – Dtype of the ones array.
placement – An optional
Placementto pin this operation to.
- Returns
A tensor of all 1s with given shape and dtype.