Skip to content

Commit 6845233

Browse files
committed
fix bool warning
1 parent 47a7ac8 commit 6845233

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ private IntPtr Allocate(NDArray nd)
5656
switch (nd.dtype.Name)
5757
{
5858
case "Boolean":
59-
Marshal.Copy(nd1.Data<byte>(), 0, dotHandle, nd.size);
59+
var boolVals = Array.ConvertAll(nd1.Data<bool>(), x => Convert.ToByte(x));
60+
Marshal.Copy(boolVals, 0, dotHandle, nd.size);
6061
break;
6162
case "Int16":
6263
Marshal.Copy(nd1.Data<short>(), 0, dotHandle, nd.size);

0 commit comments

Comments
 (0)