argmin

Performs an argmin over the specified dimension.

argmin
(,
size_t axis
,
string mod = __MODULE__
,
size_t line = __LINE__
)

Parameters

input Operation

The operation to perform argmin on.

axis size_t

The diension the argmin should be performed over.

Return Value

Type: Operation

The new argmin operation.

Examples

import dopt.core : evaluate;

auto a = float32([5], [4.0f, 2.0f, 6.0f, 1.0f, 2.0f]).argmin(0);

auto b = float32([2, 3], [
    5.0f, 1.0f, 3.0f,
    6.0f, 7.0f, 2.0f
]).argmin(1);

assert(a.evaluate().get!int == [3]);
assert(b.evaluate().get!int == [1, 2]);

Meta