Method broadcastToSameInDims
static member broadcastToSameInDims: seq<int> * Tensor<'TA> * Tensor<'TB> -> Tensor<'TA> * Tensor<'TB>
Broadcasts all specified tensors to have the same size in the specified dimensions.
Declaration
static member broadcastToSameInDims: dims:seq<int> * a:Tensor<'TA> * b:Tensor<'TB> -> Tensor<'TA> * Tensor<'TB>
Parameters
| Type | Name | Description |
|---|---|---|
| seq<int> | dims | A list of dimensions that should be broadcasted to have the same size. |
| Tensor<'TA> | a | The tensor to operate on. |
| Tensor<'TB> | b | The tensor to operate on. |
Returns
| Type | Description |
|---|---|
| Tensor<'TA> * Tensor<'TB> | A tuple of the resulting tensors, all having the same size in the specified dimensions. |
Type Parameters
| Name | Description |
|---|---|
| 'TA | |
| 'TB |
Remarks
The specified dimensions are broadcasted to match the size of non-size-one dimensions.
The operation returns a view of the original tensor and shares its storage. Modifications done to the returned tensor will affect the original tensor. Also, modifying the orignal tensor will affect the view.
Examples
let a = HostTensor.zeros [1L; 7L; 1L]
let b = HostTensor.zeros [3L; 4L; 5L]
let pa, pb = Tensor.broadcastToSameInDims ([0; 2], a, b) // pa.Shape = [3L; 7L; 5L]; pb.Shape = [3L; 4L; 5L]
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | Raised when broadcasting to a common shape is impossible. |
See Also
static member broadcastToSameInDims: seq<int> * Tensor<'TA> * Tensor<'TB> * Tensor<'TC> -> Tensor<'TA> * Tensor<'TB> * Tensor<'TC>
Broadcasts all specified tensors to have the same size in the specified dimensions.
Declaration
static member broadcastToSameInDims: dims:seq<int> * a:Tensor<'TA> * b:Tensor<'TB> * c:Tensor<'TC> -> Tensor<'TA> * Tensor<'TB> * Tensor<'TC>
Parameters
| Type | Name | Description |
|---|---|---|
| seq<int> | dims | A list of dimensions that should be broadcasted to have the same size. |
| Tensor<'TA> | a | The tensor to operate on. |
| Tensor<'TB> | b | The tensor to operate on. |
| Tensor<'TC> | c | The tensor to operate on. |
Returns
| Type | Description |
|---|---|
| Tensor<'TA> * Tensor<'TB> * Tensor<'TC> | A tuple of the resulting tensors, all having the same size in the specified dimensions. |
Type Parameters
| Name | Description |
|---|---|
| 'TA | |
| 'TB | |
| 'TC |
See Also
static member broadcastToSameInDims: seq<int> * Tensor<'T> list -> Tensor<'T> list
Broadcasts all specified tensors to have the same size in the specified dimensions.
Declaration
static member broadcastToSameInDims: dims:seq<int> * xs:Tensor<'T> list -> Tensor<'T> list
Parameters
| Type | Name | Description |
|---|---|---|
| seq<int> | dims | A list of dimensions that should be broadcasted to have the same size. |
| Tensor<'T> list | xs | A list of tensors to operate on. |
Returns
| Type | Description |
|---|---|
| Tensor<'T> list | A list of the resulting tensors, all having the same size in the specified dimensions. |