set_shape

Applicable Products

All processors

Function Usage

Sets the tensor shape.

Prototype

1
set_shape(shape: List[int]) -> TensorHolder

Parameters

Parameter

Input/Output

Description

shape

Input

Shape dimension list.

Returns

(TensorHolder) Returns itself to support chain calls.

Restrictions

  • If shape is not a list of integers, TypeError is thrown.
  • If all shape dimensions are not integers, TypeError is thrown.
  • If the operation fails, RuntimeError is thrown.