# torch_argmin: Argmin In torch: Tensors and Neural Networks with 'GPU' Acceleration

Argmin

## Arguments

 `self` (Tensor) the input tensor. `dim` (int) the dimension to reduce. If `NULL`, the argmin of the flattened input is returned. `keepdim` (bool) whether the output tensor has `dim` retained or not. Ignored if `dim=NULL`.

## argmin(input) -> LongTensor

Returns the indices of the minimum value of all elements in the `input` tensor.

This is the second value returned by `torch_min`. See its documentation for the exact semantics of this method.

## argmin(input, dim, keepdim=False, out=NULL) -> LongTensor

Returns the indices of the minimum values of a tensor across a dimension.

This is the second value returned by `torch_min`. See its documentation for the exact semantics of this method.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11``` ```if (torch_is_installed()) { a = torch_randn(c(4, 4)) a torch_argmin(a) a = torch_randn(c(4, 4)) a torch_argmin(a, dim=1) } ```

torch documentation built on Oct. 7, 2021, 9:22 a.m.
{"ft_lang_label":"__label__en","ft_lang_prob":0.643752,"math_prob":0.82875866,"size":888,"snap":"2021-43-2021-49","text_gpt3_token_len":239,"char_repetition_ratio":0.12895928,"word_repetition_ratio":0.24827586,"special_character_ratio":0.2635135,"punctuation_ratio":0.10429448,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9724542,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-25T01:10:30Z\",\"WARC-Record-ID\":\"<urn:uuid:45afe7b5-959b-476d-bc0a-b995e58054b5>\",\"Content-Length\":\"50032\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:7c05f3a7-7896-4e0d-870f-4ed31f6dc80c>\",\"WARC-Concurrent-To\":\"<urn:uuid:c14d408c-27fb-4790-ad3b-3f81755dad8d>\",\"WARC-IP-Address\":\"51.81.83.12\",\"WARC-Target-URI\":\"https://rdrr.io/cran/torch/man/torch_argmin.html\",\"WARC-Payload-Digest\":\"sha1:RERFWHFPFSGTZRX6SKFLXSIO3SPBVCIU\",\"WARC-Block-Digest\":\"sha1:XA6LLBP6PVRX5JZRIISQCYPKB5ULKEHN\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323587608.86_warc_CC-MAIN-20211024235512-20211025025512-00444.warc.gz\"}"}