Skip to content

armgit / uzu

Public Imported from GitHub
0

A high-performance inference engine for AI models

235 B
Raw Blame
#pragma once

#include <metal_stdlib>

#include "defines.h"

namespace uzu {

template <typename T>
METAL_FUNC T apply_soft_cap(T value, float cap) {
  return static_cast<T>(cap * metal::fast::tanh(value / cap));
}

} // namespace uzu