Method mapi
val mapi: int64 [] -> 'T -> 'R -> Tensor<'T> -> Tensor<'R>
Applies to specified indexed function to all elements of the tensor.
Declaration
val mapi: fn:int64 [] -> 'T -> 'R -> a:Tensor<'T> -> Tensor<'R>
Parameters
| Type | Name | Description |
|---|---|---|
| int64 [] -> 'T -> 'R | fn | A function that takes an index and the corresponding value from the input tensor and returns the corresponding output value. |
| Tensor<'T> | a | The source tensor. |
Returns
| Type | Description |
|---|---|
| Tensor<'R> | The output tensor. |
Type Parameters
| Name | Description |
|---|---|
| 'T | The type of the data. |
| 'R |