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 std::string &description() const

Get the string name for the type of the node, such as Add or Multiply. The class name, must not contain spaces as it is used for codegen.

Return

A const reference to the node’s type name

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.