Convert

Convert // Convert a tensor from one element type to another

Description

Long description

Inputs

Name Element Type Shape
arg Any Any

Attributes

Name Type Notes
element_type ngraph::element::type The element type of the result

Outputs

Name Element Type Shape
output element_type Same as arg

Backprop

\[\overline{\mathtt{arg}} \leftarrow \mathtt{Convert}(\Delta,\mathtt{arg->get_element_type()})\]

C++ Interface

class Convert : public ngraph::op::Op

Elementwise type conversion operation.

Public Functions

const NodeTypeInfo &get_type_info() const

Returns the NodeTypeInfo for the node’s class. During transition to type_info, returns a dummy type_info for Node if the class has not been updated yet.

Convert()

Constructs a conversion operation.

Convert(const Output<Node> &arg, const ngraph::element::Type &element_type)

Constructs a conversion operation.

Parameters
  • arg: Node that produces the input tensor.
  • element_type: Element type for the output tensor.

void validate_and_infer_types()

Throws if the node is invalid.