TensorDimensions

TensorDimensions[tensor]

gives the list of dimensions of tensor.

Details and Options

  • TensorDimensions accepts any type of tensor, either symbolic or explicit, including any type of array.
  • On explicit rectangular arrays, TensorDimensions coincides with Dimensions. On symbolic arrays, TensorDimensions stays unevaluated unless the array has been assigned a rank through any form of assumption.

Examples

open allclose all

Basic Examples  (3)

Dimensions of an array:

Dimensions of an array symbol:

Dimensions of a symbolic array expression:

Scope  (4)

Dimensions of explicit arrays:

Dimensions of symbolic arrays:

Dimensions of vector, matrix, and array symbols:

Dimensions of general tensor expressions:

Options  (2)

Assumptions  (1)

Specify locally the domain of a symbolic array:

GenerateConditions  (1)

By default, TensorDimensions quietly makes assumptions necessary for the input to be well-defined:

With GenerateConditionsTrue, TensorDimensions gives a conditional result:

With GenerateConditionsNone, TensorDimensions fails when assumptions are necessary:

Properties & Relations  (2)

On explicit rectangular arrays, TensorDimensions coincides with Dimensions:

For symbolic expressions, there are no default dimensions assumed:

Use assumptions to assign dimensions to the array:

Possible Issues  (1)

It is not possible to mix incompatible local and global assumptions:

Wolfram Research (2012), TensorDimensions, Wolfram Language function, https://reference.wolfram.com/language/ref/TensorDimensions.html (updated 2024).

Text

Wolfram Research (2012), TensorDimensions, Wolfram Language function, https://reference.wolfram.com/language/ref/TensorDimensions.html (updated 2024).

CMS

Wolfram Language. 2012. "TensorDimensions." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/TensorDimensions.html.

APA

Wolfram Language. (2012). TensorDimensions. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TensorDimensions.html

BibTeX

@misc{reference.wolfram_2024_tensordimensions, author="Wolfram Research", title="{TensorDimensions}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/TensorDimensions.html}", note=[Accessed: 26-July-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_tensordimensions, organization={Wolfram Research}, title={TensorDimensions}, year={2024}, url={https://reference.wolfram.com/language/ref/TensorDimensions.html}, note=[Accessed: 26-July-2024 ]}