argmin

Performs an argmin over the specified dimension.

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

Parameters

input
Type: Operation

The operation to perform argmin on.

axis
Type: size_t

The diension the argmin should be performed over.

Return Value

Type: Operation

The new argmin operation.

Examples

1 import dopt.core : evaluate;
2 
3 auto a = float32([5], [4.0f, 2.0f, 6.0f, 1.0f, 2.0f]).argmin(0);
4 
5 auto b = float32([2, 3], [
6     5.0f, 1.0f, 3.0f,
7     6.0f, 7.0f, 2.0f
8 ]).argmin(1);
9 
10 assert(a.evaluate().as!int == [3]);
11 assert(b.evaluate().as!int == [1, 2]);

Meta