Function reshape

  • Reshape a Tensor without modifying the underlying data. There is a method version of this static function: Tensor.reshape.

    Remarks

    The resultant shape must contain the same number of elements as the base Tensor.

    Example

      const t = sm.randn([64])

    // equivalent calls
    const a = t.reshape([8, 8])
    const b = sm.reshape(t, [8, 8])

    Parameters

    • tensor: Tensor

      Tensor to reshape

    • shape: BigInt64Array | number[]

      The shape of the output Tensor

    Returns Tensor

Generated using TypeDoc