microsoft / DirectML

DirectML is a high-performance, hardware-accelerated DirectX 12 library for machine learning. DirectML provides GPU acceleration for common machine learning tasks across a broad range of supported hardware and drivers, including all DirectX 12-capable GPUs from vendors such as AMD, Intel, NVIDIA, and Qualcomm.
MIT License
2.24k stars 299 forks source link

Resample: Axis direction #643

Open schm0 opened 2 months ago

schm0 commented 2 months ago

Hello! The DirectMLX.h header file has the following definition:

    inline Expression Resample(
        Expression input,
        TensorDimensions outputSizes,
        DML_INTERPOLATION_MODE mode,
#if DML_TARGET_VERSION >= 0x5100
        DML_AXIS_DIRECTION roundingDirection = DML_AXIS_DIRECTION_INCREASING,
#endif // DML_TARGET_VERSION >= 0x5100
        Span<const float> scales = {},
        Span<const float> inputPixelOffsets = {},
        Span<const float> outputPixelOffsets = {} 
#if DML_TARGET_VERSION >= 0x6400
        , bool antialiased = false
#endif
        )

How should the axis direction calculated? e.g. different direction for down or up sampling? Different direction for nearest neighbor vs linear? Or does that not really matter? Thanks!