CastLike

CastLike - 25

版本

  • 名称: CastLike (GitHub)

  • : main

  • since_version: 25

  • 函数: True

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的操作符已在版本 25 及之后可用。

摘要

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

属性

  • round_mode - 字符串(默认为 'up'

    转换为 float8e8m0 的舍入模式。它仅适用于转换为 float8e8m0,默认为 upup:向远离零的方向取最近值舍入,down:向靠近零的方向取最近值舍入,nearest:取最近值舍入,并向上舍入平局情况。有关更多详细信息,请参阅运算符 Cast 描述。

  • saturate - 整型 (默认为 '1')

    此参数定义了当输入值超出目标类型范围时转换的行为。它仅适用于 float 8 转换(float8e4m3fn、float8e4m3fnuz、float8e5m2、float8e5m2fnuz、float8e8m0)。默认为 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(float8e8m0), tensor(int16), tensor(int2), tensor(int32), tensor(int4), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint2), 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(float8e8m0), tensor(int16), tensor(int2), tensor(int32), tensor(int4), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint2), tensor(uint32), tensor(uint4), tensor(uint64), tensor(uint8) )

    限制输出类型。不支持转换为复数。

CastLike - 24

版本

  • 名称: CastLike (GitHub)

  • : main

  • 起始版本24

  • 函数: True

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的操作符已可用于版本 24 及以上

摘要

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

属性

  • round_mode - 字符串(默认为 'up'

    转换为 float8e8m0 的舍入模式。它仅适用于转换为 float8e8m0,默认为 upup:向远离零的方向取最近值舍入,down:向靠近零的方向取最近值舍入,nearest:取最近值舍入,并向上舍入平局情况。有关更多详细信息,请参阅运算符 Cast 描述。

  • saturate - 整型 (默认为 '1')

    此参数定义了当输入值超出目标类型范围时转换的行为。它仅适用于 float 8 转换(float8e4m3fn、float8e4m3fnuz、float8e5m2、float8e5m2fnuz、float8e8m0)。默认为 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(float8e8m0), 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(float8e8m0), tensor(int16), tensor(int32), tensor(int4), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint4), tensor(uint64), tensor(uint8) )

    限制输出类型。不支持转换为复数。

CastLike - 23

版本

  • 名称: CastLike (GitHub)

  • : main

  • 起始版本23

  • 函数: True

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的操作符已可用于版本 23 及以上

摘要

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

属性

  • saturate - 整型 (默认为 '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

  • since_version: 21

  • 函数: True

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的操作符自 版本 21 起可用。

摘要

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

属性

  • saturate - 整型 (默认为 '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

  • since_version: 19

  • 函数: True

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的操作符自 版本 19 起可用。

摘要

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

属性

  • saturate - 整型 (默认为 '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) )

    限制输出类型。不支持转换为复数。