Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14722,7 +14722,7 @@ private static Vector512<T> ElementWiseSelect<T>(Vector512<T> mask, Vector512<T>
/// <summary>1 / (1 + T.Exp(-x))</summary>
internal readonly struct SigmoidOperator<T> : IUnaryOperator<T, T> where T : IExponentialFunctions<T>
{
public static bool Vectorizable => typeof(T) == typeof(float);
public static bool Vectorizable => ExpOperator<T>.Vectorizable;
public static T Invoke(T x) => T.One / (T.One + T.Exp(-x));
public static Vector128<T> Invoke(Vector128<T> x) => Vector128.Create(T.One) / (Vector128.Create(T.One) + ExpOperator<T>.Invoke(-x));
public static Vector256<T> Invoke(Vector256<T> x) => Vector256.Create(T.One) / (Vector256.Create(T.One) + ExpOperator<T>.Invoke(-x));
Expand Down