Table of Contents

Class DatetimeTimedeltaCastingImpl

Namespace
NumSharp
Assembly
NumSharp.dll

The cast between datetime64 and timedelta64 (either direction) — NumPy's datetime_to_timedelta_resolve_descriptors: the destination inherits the SOURCE's unit when none is given (which is how promote_types turns m8[Y] into M8[Y] before taking the GCD), and the cast is always unsafe.

public sealed class DatetimeTimedeltaCastingImpl : CastingImpl
Inheritance
DatetimeTimedeltaCastingImpl
Inherited Members

Methods

ResolveDescriptors(DType[], DType[], out long)

resolve_descriptors: given the operand descriptors (an output entry may be null — "please pick"), fills loopDescrs with the descriptors the loop will actually run on and returns the cast safety of doing so. viewOffset is the byte offset at which the operation is a plain VIEW (0 for a no-op cast between identical descriptors), or NoView.

public override NPY_CASTING ResolveDescriptors(DType[] givenDescrs, DType[] loopDescrs, out long viewOffset)

Parameters

givenDescrs DType[]
loopDescrs DType[]
viewOffset long

Returns

NPY_CASTING

Exceptions

TypeError

The descriptors cannot be resolved (NumPy returns -1 with an error set).