TypeTensor - v0.1.0
    Preparing search index...

    Class RuntimeShape<S>

    Runtime representation of a tensor shape with computed properties Provides efficient access to shape metadata and validation

    Type Parameters

    Index

    Constructors

    Properties

    dims: S

    Accessors

    • get strides(): readonly number[]

      Strides for each dimension (row-major order) Used for efficient memory access calculations

      Returns readonly number[]

    Methods

    • Check if two shapes can be matrix multiplied

      Matrix multiplication is valid when:

      • Both tensors have at least 1 dimension
      • The last dimension of the first tensor equals the second-to-last dimension of the second
      • All batch dimensions (if any) match exactly

      Parameters

      • shape1: Shape

        First tensor shape

      • shape2: Shape

        Second tensor shape

      Returns boolean

      true if shapes can be matrix multiplied