Class NumSharpException
- Namespace
- NumSharp
- Assembly
- NumSharp.dll
public class NumSharpException : Exception, ISerializable, INumSharpException
- Inheritance
-
NumSharpException
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
NumSharpException()
Initializes a new instance of the Exception class.
public NumSharpException()
NumSharpException(string)
Initializes a new instance of the Exception class with a specified error message.
public NumSharpException(string message)
Parameters
messagestringThe message that describes the error.
NumSharpException(string, Exception)
Initializes a new instance of the Exception class with a specified error message and a reference to the inner exception that is the cause of this exception.
public NumSharpException(string message, Exception innerException)
Parameters
messagestringThe error message that explains the reason for the exception.
innerExceptionExceptionThe exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.
Methods
ThrowIfNotWriteable(in Shape, string)
Throws if the shape is not writeable (e.g., broadcast arrays). Equivalent to NumPy's PyArray_FailUnlessWriteable.
public static void ThrowIfNotWriteable(in Shape shape, string name = "assignment destination")
Parameters
shapeShapeThe shape to check.
namestringName for the array in the error message (default: "assignment destination").
Remarks
NumPy raises: ValueError: assignment destination is read-only NumSharp raises: NumSharpException: assignment destination is read-only
Exceptions
- NumSharpException
If the shape is not writeable.
ThrowReadOnly(string)
Throws the read-only exception with the standard NumPy error format.
[DoesNotReturn]
public static void ThrowReadOnly(string name = "assignment destination")
Parameters
namestringName for the array in the error message.