SetTensorShape

Description

Sets an attribute value of type TensorShape.

Prototype

bool SetTensorShape(const TensorShape *shape)

Parameters

Parameter

Input/Output

Description

shape

Input

TensorShape for the attribute value.

Returns

A bool:

  • true on success;
  • false on failure.

Restrictions

None

Example

This following shows how to set operator A's attribute value during operator implementation.

AttrValue *attr = ctx.GetAttr("attr1");
bool ret = attr->SetTensorShape(shape);