CastLike

CastLike - 版本 23

版本

  • 名称: CastLike (GitHub)

  • : main

  • 自版本: 23

  • 函数: True

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的运算符**自版本 23** 起可用。

摘要

此运算符将给定输入张量(第一个输入)的元素转换为与第二个输入张量元素相同的数据类型。更多详细信息请参阅 Cast 运算符的文档。

属性

  • saturate - INT (默认值为 '1')

    此参数定义了如果输入值超出目标类型范围时转换的行为方式。它仅适用于 float 8 转换 (float8e4m3fn, float8e4m3fnuz, float8e5m2, float8e5m2fnuz)。默认为 true。更多详细信息请参阅 Cast 运算符说明。

输入

  • input (异构) - T1

    要进行类型转换的输入张量。

  • target_type (异构) - T2

    (第一个)输入张量将被转换为与此(第二个输入)张量相同类型的张量。

输出

  • output (异构) - T2

    将第一个输入张量转换为与第二个输入张量相同类型而产生的输出张量。

类型约束

  • T1 在 ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(float4e2m1), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(int16), tensor(int32), tensor(int4), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint4), tensor(uint64), tensor(uint8) )

    约束输入类型。不支持从复数类型转换。

  • T2 在 ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(float4e2m1), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(int16), tensor(int32), tensor(int4), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint4), tensor(uint64), tensor(uint8) )

    约束输出类型。不支持转换为复数类型。

CastLike - 版本 21

版本

  • 名称: CastLike (GitHub)

  • : main

  • 自版本: 21

  • 函数: True

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的运算符**自版本 21** 起可用。

摘要

此运算符将给定输入张量(第一个输入)的元素转换为与第二个输入张量元素相同的数据类型。更多详细信息请参阅 Cast 运算符的文档。

属性

  • saturate - INT (默认值为 '1')

    此参数定义了如果输入值超出目标类型范围时转换的行为方式。它仅适用于 float 8 转换 (float8e4m3fn, float8e4m3fnuz, float8e5m2, float8e5m2fnuz)。默认为 true。更多详细信息请参阅 Cast 运算符说明。

输入

  • input (异构) - T1

    要进行类型转换的输入张量。

  • target_type (异构) - T2

    (第一个)输入张量将被转换为与此(第二个输入)张量相同类型的张量。

输出

  • output (异构) - T2

    将第一个输入张量转换为与第二个输入张量相同类型而产生的输出张量。

类型约束

  • T1 在 ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(int16), tensor(int32), tensor(int4), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint4), tensor(uint64), tensor(uint8) )

    约束输入类型。不支持从复数类型转换。

  • T2 在 ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(int16), tensor(int32), tensor(int4), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint4), tensor(uint64), tensor(uint8) )

    约束输出类型。不支持转换为复数类型。

CastLike - 版本 19

版本

  • 名称: CastLike (GitHub)

  • : main

  • 自版本: 19

  • 函数: True

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的运算符**自版本 19** 起可用。

摘要

此运算符将给定输入张量(第一个输入)的元素转换为与第二个输入张量元素相同的数据类型。更多详细信息请参阅 Cast 运算符的文档。

属性

  • saturate - INT (默认值为 '1')

    此参数定义了如果输入值超出目标类型范围时转换的行为方式。它仅适用于 float 8 转换 (float8e4m3fn, float8e4m3fnuz, float8e5m2, float8e5m2fnuz)。默认为 true。更多详细信息请参阅 Cast 运算符说明。

输入

  • input (异构) - T1

    要进行类型转换的输入张量。

  • target_type (异构) - T2

    (第一个)输入张量将被转换为与此(第二个输入)张量相同类型的张量。

输出

  • output (异构) - T2

    将第一个输入张量转换为与第二个输入张量相同类型而产生的输出张量。

类型约束

  • T1 在 ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) )

    约束输入类型。不支持从复数类型转换。

  • T2 在 ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) )

    约束输出类型。不支持转换为复数类型。

CastLike - 版本 15

版本

  • 名称: CastLike (GitHub)

  • : main

  • 自版本: 15

  • 函数: True

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的运算符**自版本 15** 起可用。

摘要

此运算符将给定输入张量(第一个输入)的元素转换为与第二个输入张量元素相同的数据类型。更多详细信息请参阅 Cast 运算符的文档。

输入

  • input (异构) - T1

    要进行类型转换的输入张量。

  • target_type (异构) - T2

    (第一个)输入张量将被转换为与此(第二个输入)张量相同类型的张量。

输出

  • output (异构) - T2

    将第一个输入张量转换为与第二个输入张量相同类型而产生的输出张量。

类型约束

  • T1 在 ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) )

    约束输入类型。不支持从复数类型转换。

  • T2 在 ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) )

    约束输出类型。不支持转换为复数类型。