partial_tensor_to_vec#

ivy.partial_tensor_to_vec(x, /, skip_begin=1, skip_end=0, *, out=None)[source]#

Partial vectorization of a tensor while ignoring the specified dimension at the beginning and the end.

Parameters:
  • x (Union[Array, NativeArray]) – tensor to partially vectorise

  • skip_begin (int, default: 1) – number of dimensions to leave untouched at the beginning

  • skip_end (int, default: 0) – number of dimensions to leave untouched at the end

  • out (Optional[Array], default: None) – optional output array, for writing the result to.

Return type:

Array

Returns:

ret – partially vectorised tensor with the skip_begin first and skip_end last dimensions untouched

Array.partial_tensor_to_vec(self, /, skip_begin=1, skip_end=0, *, out=None)[source]#

ivy.Array instance method variant of ivy.partial_tensor_to_vec. This method simply wraps the function, and so the docstring for ivy.partial_tensor_to_vec also applies to this method with minimal changes.

Parameters:
  • x – tensor to partially vectorise

  • skip_begin (Optional[int], default: 1) – number of dimensions to leave untouched at the beginning

  • skip_end (Optional[int], default: 0) – number of dimensions to leave untouched at the end

  • out (Optional[Array], default: None) – optional output array, for writing the result to.

Return type:

Array

Returns:

  • partially vectorised tensor with the

  • skip_begin first and skip_end last dimensions untouched

Container.partial_tensor_to_vec(self, /, skip_begin=1, skip_end=0, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

ivy.Container instance method variant of ivy.partial_tensor_to_vec.

This method simply wraps the function, and so the docstring for ivy.partial_tensor_to_vec also applies to this method with minimal changes.

Parameters:
  • self (Union[Array, NativeArray, Container]) – tensor to partially vectorise

  • skip_begin (Optional[Union[int, Container]], default: 1) – number of dimensions to leave untouched at the beginning

  • skip_end (Optional[Union[int, Container]], default: 0) – number of dimensions to leave untouched at the end

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – partially re-folded tensor