forked from SciSharp/NumSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnp.empty_like.cs
More file actions
19 lines (18 loc) · 843 Bytes
/
np.empty_like.cs
File metadata and controls
19 lines (18 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System;
namespace NumSharp
{
public static partial class np
{
/// <summary>
/// Return a new array with the same shape and type as a given array.
/// </summary>
/// <param name="prototype">The shape and data-type of prototype define these same attributes of the returned array.</param>
/// <param name="dtype">Overrides the data type of the result.</param>
/// <returns>Array of uninitialized (arbitrary) data with the same shape and type as prototype.</returns>
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.empty_like.html</remarks>
public static NDArray empty_like(NDArray prototype, Type dtype = null)
{
return new NDArray(dtype ?? prototype.dtype, new Shape(prototype.shape), false);
}
}
}