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
11 changes: 10 additions & 1 deletion dotnet/src/dotnetcore/GxClasses/Domain/GxEmbedding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ internal GxEmbedding(float[] embedding)
}
public bool IsEmpty()
{
return _embedding.IsEmpty;
ReadOnlySpan<float> span = _embedding.Span;
if (span != null)
{
for (int i = 0; i < span.Length; i++)
{
if (span[i] != 0f)
return false;
}
}
return true;
}
internal static GxEmbedding Empty(string model, int dimensions)
{
Expand Down
Loading