# Method swapDim

#### static member swapDim: int -> int -> Tensor<'T> -> Tensor<'T>

Swaps the specified dimensions of the tensor.

##### Declaration

`static member swapDim: ax1:int -> ax2:int -> a:Tensor<'T> -> Tensor<'T>`

##### Parameters

Type | Name | Description |
---|---|---|

int | ax1 | The dimension to swap. |

int | ax2 | The dimension to swap with. |

Tensor<'T> | a | The tensor to operate on. |

##### Returns

Type | Description |
---|---|

Tensor<'T> | The tensor with the dimensions swapped. |

##### Remarks

A view of the original tensor is returned and the storage is shared. Modifications done to the returned tensor will affect the original tensor.

##### Examples

```
let a = HostTensor.zeros [2L; 3L; 4L]
let b = Tensor.swapDim 0 2 a // b.Shape = [4L; 3L; 2L]
```