choose_shape_attr_or_api

paddle.fluid.dygraph.dygraph_to_static.convert_operators. choose_shape_attr_or_api ( attr_shape, api_shape, idx=None ) [source]

Input can be attribute x.shape or api shape(x), this function chooses which one to return to use in dy2stat.

Note: sometimes users write x.shape[3], so attr_shape can be an integer.