def _broadcast_to_shape(context, builder, arrtype, arr, target_shape):
 shapes = cgutils.unpack_tuple(builder, arr.shape)
 strides = cgutils.unpack_tuple(builder, arr.strides)
 (shapes, strides) = _bc_adjust_dimension(context, builder, shapes, strides, target_shape)
 (shapes, strides) = _bc_adjust_shape_strides(context, builder, shapes, strides, target_shape)
 new_arrtype = arrtype.copy(ndim=len(target_shape), layout='A')
 new_arr = make_array(new_arrtype)(context, builder)
 repl = dict(shape=cgutils.pack_array(builder, shapes), strides=cgutils.pack_array(builder, strides))
 cgutils.copy_struct(new_arr, arr, repl)
 return (new_arrtype, new_arr)

def _broadcast_to_shape ( context , builder , arrtype , arr , target_shape ) : shapes = cgutils . unpack_tuple ( builder , arr . shape ) strides = cgutils . unpack_tuple ( builder , arr . strides ) ( shapes , strides ) = _bc_adjust_dimension ( context , builder , shapes , strides , target_shape ) ( shapes , strides ) = _bc_adjust_shape_strides ( context , builder , shapes , strides , target_shape ) new_arrtype = arrtype . copy ( ndim = len ( target_shape ) , layout = 'A' ) new_arr = make_array ( new_arrtype ) ( context , builder ) repl = dict ( shape = cgutils . pack_array ( builder , shapes ) , strides = cgutils . pack_array ( builder , strides ) ) cgutils . copy_struct ( new_arr , arr , repl ) return ( new_arrtype , new_arr )
broadcast the given array to the target_shape .