Skip to content

Commit db13271

Browse files
committed
Changed NDArray.Scalar from accepting object to ValueType.
1 parent 6f96e61 commit db13271

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/NumSharp.Core/Creation/NdArray.Scalar.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public partial class NDArray
1818
/// <param name="dtype">The type of the scalar.</param>
1919
/// <returns></returns>
2020
/// <remarks>In case when <see cref="value"/> is not <see cref="dtype"/>, <see cref="Convert.ChangeType(object,System.Type)"/> will be called.</remarks>
21-
public static NDArray Scalar(object value, Type dtype)
21+
public static NDArray Scalar(ValueType value, Type dtype)
2222
{
2323
return new NDArray(UnmanagedStorage.Scalar(Convert.ChangeType(value, dtype)));
2424
}
@@ -29,7 +29,7 @@ public static NDArray Scalar(object value, Type dtype)
2929
/// <param name="value">The value of the scalar</param>
3030
/// <returns></returns>
3131
/// <remarks>In case when <see cref="value"/> is not <see cref="dtype"/>, <see cref="Convert.ChangeType(object,System.Type)"/> will be called.</remarks>
32-
public static NDArray Scalar(object value)
32+
public static NDArray Scalar(ValueType value)
3333
{
3434
return new NDArray(UnmanagedStorage.Scalar(value));
3535
}
@@ -52,7 +52,7 @@ public static NDArray Scalar<T>(T value) where T : unmanaged
5252
/// <param name="typeCode">The type code of the scalar.</param>
5353
/// <returns></returns>
5454
/// <remarks>In case when <see cref="value"/> is not <see cref="dtype"/>, <see cref="Convert.ChangeType(object,System.Type)"/> will be called.</remarks>
55-
public static NDArray Scalar(object value, NPTypeCode typeCode)
55+
public static NDArray Scalar(ValueType value, NPTypeCode typeCode)
5656
{
5757
return new NDArray(UnmanagedStorage.Scalar(Convert.ChangeType(value, typeCode.AsType())));
5858
}

0 commit comments

Comments
 (0)