Skip to content
Snippets Groups Projects
Commit ea42bc29 authored by Vincent Templier's avatar Vincent Templier
Browse files

Add aidge kernels for export forward

parent f04dc2a5
No related branches found
No related tags found
No related merge requests found
Showing with 107 additions and 0 deletions
#include <math.h>
void aidge_atan_float32 (float* input,
float* output,
unsigned int size)
{
for (unsigned int i = 0; i < size; ++i) {
output[i] = atanf(input[i]);
}
}
void aidge_relu_float32 (float* inputs,
float* outputs,
unsigned int size)
{
for (unsigned int i = 0; i < size; ++i) {
if (inputs[i] < 0.0f)
outputs[i] = 0.0f;
}
}
\ No newline at end of file
#include <stdarg.h>
void aidge_concat_float32 (unsigned int axis,
float* output,
float* input1,
float* input2)
{
// TODO
}
void aidge_mul_float32(float* input_a,
float* input_b,
float* output,
unsigned int size)
{
for (unsigned int i = 0; i < size; ++i) {
output[i] = input_a[i] + input_b[i];
}
}
\ No newline at end of file
void aidge_mul_float32(float* input_a,
float* input_b,
float* output,
unsigned int size)
{
for (unsigned int i = 0; i < size; ++i) {
output[i] = input_a[i] / input_b[i];
}
}
\ No newline at end of file
void aidge_mul_float32(float* input_a,
float* input_b,
float* output,
unsigned int size)
{
for (unsigned int i = 0; i < size; ++i) {
output[i] = input_a[i] * input_b[i];
}
}
\ No newline at end of file
void aidge_sub_float32(float* input_a,
float* input_b,
float* output,
unsigned int size)
{
for (unsigned int i = 0; i < size; ++i) {
output[i] = input_a[i] - input_b[i];
}
}
\ No newline at end of file
void aidge_fc_float32 (float* inputs,
float* weights,
float* biases,
float* outputs,
unsigned int nb_inputs,
unsigned int nb_outputs)
{
for (unsigned int out = 0; out < nb_outputs; ++out) {
// Init with bias
float accum = biases[out];
for (unsigned int in = 0; in < nb_inputs; ++in) {
accum += inputs[in] * weights[out * nb_inputs + in];
}
// Store result
outputs[out] = accum;
}
}
void aidge_slice_float32 (float* inputs,
float* outputs,
int* axes,
int* starts,
int* ends,
unsigned int nb_axes)
{
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment