broadcast_constant
broadcast_constant(base_array, target_shape, pad_base=False):
LLM Docstring
Broadcast a scalar or array up to a target shape.
A scalar is filled into target_shape; an array is expanded with leading axes
so it broadcasts against target_shape (with the array’s own shape appended
when pad_base is set).
base_array:float | np.ndarraythe value to broadcast
target_shape:tuple[int, ...]the desired leading shape
pad_base:boolappend the base array’s shape to the target shape
:returns:np.ndarraythe broadcast array