aesara.tensor.alloc#
- aesara.tensor.alloc = <aesara.tensor.basic.Alloc object>[source]#
Create a
TensorVariablefrom 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
Opis used to replacefillduring optimizations, because, after shapes are lifted, the first argument tofillcan often be pruned from the graph.