MCPcopy Create free account
hub / github.com/pybind/pybind11 / apply_broadcast

Method apply_broadcast

include/pybind11/numpy.h:2256–2272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2254
2255 template <size_t... Index, size_t... VIndex, size_t... BIndex>
2256 void apply_broadcast(std::array<buffer_info, NVectorized> &buffers,
2257 std::array<void *, N> &params,
2258 Return *out,
2259 size_t size,
2260 const std::vector<ssize_t> &output_shape,
2261 index_sequence<Index...>,
2262 index_sequence<VIndex...>,
2263 index_sequence<BIndex...>) {
2264
2265 multi_array_iterator<NVectorized> input_iter(buffers, output_shape);
2266
2267 for (size_t i = 0; i < size; ++i, ++input_iter) {
2268 PYBIND11_EXPAND_SIDE_EFFECTS((params[VIndex] = input_iter.template data<BIndex>()));
2269 returned_array::call(
2270 out, i, f, *reinterpret_cast<param_n_t<Index> *>(std::get<Index>(params))...);
2271 }
2272 }
2273};
2274
2275template <typename Func, typename Return, typename... Args>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected