← Back to C-Kernel-Engine Docs Doxygen Source Documentation
Loading...
Searching...
No Matches
ckernel_grouped_weighted_rows.h
Go to the documentation of this file.
1#ifndef CKE_GROUPED_WEIGHTED_ROWS_H
2#define CKE_GROUPED_WEIGHTED_ROWS_H
3
4#include <stddef.h>
5#include <stdint.h>
6
7/* For each group, softmax(dot(options[row], field[group]) / sqrt(channels))
8 * across its consecutive option rows, then sum the weighted option rows.
9 * All buffers are caller-owned. Read buffers may alias; output and scratch
10 * must not overlap each other or any read buffer. Scratch needs at least
11 * option_rows + groups * channels floats. Rejection leaves output unchanged. */
13 const float *options, size_t option_elements, size_t option_stride,
14 const float *fields, size_t field_elements, size_t field_stride,
15 const int32_t *group_counts, size_t count_elements,
16 float *output, size_t output_elements, size_t output_stride,
17 float *scratch, size_t scratch_elements,
18 size_t groups, size_t option_rows, size_t channels);
19
20#endif
int ck_grouped_softmax_weighted_rows_f32(const float *options, size_t option_elements, size_t option_stride, const float *fields, size_t field_elements, size_t field_stride, const int32_t *group_counts, size_t count_elements, float *output, size_t output_elements, size_t output_stride, float *scratch, size_t scratch_elements, size_t groups, size_t option_rows, size_t channels)