Skip to content

Commit

Permalink
Fix model reloading bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongkaifu committed Sep 22, 2023
1 parent 8f2af2d commit 1ce1784
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Seq2SeqSharp/Tools/WeightTensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,11 @@ public void SetWeightArray(float[] v)
halves[i] = new half(v[i]);
}

TWeight.SetElementsAsHalf(halves);
m_TWeight.SetElementsAsHalf(halves);
}
else
{
TWeight.SetElementsAsFloat(v);
m_TWeight.SetElementsAsFloat(v);
}
}

Expand All @@ -514,7 +514,7 @@ public void SetWeightArray(half[] v)
throw new InvalidCastException($"Inconsistent element type in weights '{Name}'");
}

TWeight.SetElementsAsHalf(v);
m_TWeight.SetElementsAsHalf(v);
}

public WeightTensor CopyWeightsRef(string name, bool needGradient, IComputeGraph graphToBind)
Expand Down

0 comments on commit 1ce1784

Please sign in to comment.