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 dtype and shape.

Parameters
  • shape – Shape of the ones array.

  • dtype – Dtype of the ones array.

  • placement – An optional Placement to pin this operation to.

Returns

A tensor of all 1s with given shape and dtype.