aesara.tensor.alloc

Contents

aesara.tensor.alloc#

aesara.tensor.alloc = <aesara.tensor.basic.Alloc object>[source]#

Create a TensorVariable from an initial value and a desired shape.

Usage:

alloc(value, shape0, shape1, …, shapeN)

Returns an N-dimensional tensor initialized by a value, using something equivalent to

z = numpy.zeros(shape, value.dtype) z += value

The result has N dimensions, has the dtype of the given value, and is obtained by broadcasting value over the output array.

This Op is used to replace fill during optimizations, because, after shapes are lifted, the first argument to fill can often be pruned from the graph.