is_variable

ivy.is_variable(x, exclusive=False, f=None)[source]

Determines whether the input is a variable or not.

Parameters
  • x (array) – An ivy array.

  • exclusive (bool, optional) – Whether to check if the data type is exclusively a variable, rather than an array. For frameworks like JAX that do not have exclusive variable types, the function will always return False if this flag is set, otherwise the check is the same for general arrays. Default is False.

  • f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.

Returns

Boolean, true if x is a trainable variable, false otherwise.


Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty