tensor.rewriting.basic – Tensor Rewrites¶
Tensor optimizations addressing the ops in basic.py.
broadcast_like(value, template, fgraph, dtype=None)¶
Return a Variable with the same shape and dtype as the template, filled by broadcasting value through it.
valuewill be cast as necessary.
- b1 – The broadcastable attribute of a tensor type.
- b2 – The broadcastable attribute of a tensor type.
True if the broadcastable patterns b1 and b2 are such that b2 is broadcasted to b1’s shape and not the opposite.
Given two data types (as strings), check if converting to type2 from type1 constitutes an upcast. Differs from aesara.scalar.upcast