Function broadcastBatchedMatmul

  • If the first argument is 1-dimensional, a 1 is prepended to its dimension for the purpose of the batched matrix multiply and removed after. If the second argument is 1-dimensional, a 1 is appended to its dimension for the purpose of the batched matrix multiple and removed after. The non-matrix (i.e. batch) dimensions are broadcasted (and thus must be broadcastable).

    For example,

    if input is a (j×1×n×n) tensor and other is a (k×n×n) tensor, out will be a (j×k×n×n) tensor. Note that the broadcasting logic only looks at the batch dimensions when determining if the inputs are broadcastable, and not the matrix dimensions.

    For example,

    if input is a (j×1×n×m) tensor and other is a (k×m×p) tensor, these inputs are valid for broadcasting even though the final two dimensions (i.e. the matrix dimensions) are different. out will be a (j×k×n×p) tensor.

    Parameters

    Returns {
        a: StridedShape;
        b: StridedShape;
        output: StridedShape;
    }

    The shapes and strides of the inputs and the output

Generated using TypeDoc