CastLike

CastLike - 23

版本

  • 名称: CastLike (GitHub)

  • 域名: main

  • since_version: 23

  • function: True

  • support_level: SupportType.COMMON

  • 形状推断: True

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

摘要

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

属性

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

    该参数定义了当输入值超出目标类型的范围时,转换的行为方式。它仅适用于float 8转换(float8e4m3fn, float8e4m3fnuz, float8e5m2, float8e5m2fnuz)。默认情况下为true。有关更多详细信息,请参阅操作符Cast的描述。

输入

  • 输入 (异构) - T1:

    要转换的输入张量。

  • target_type (异构) - T2:

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

输出

  • 输出 (异构) - 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

  • function: True

  • support_level: SupportType.COMMON

  • 形状推断: True

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

摘要

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

属性

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

    该参数定义了当输入值超出目标类型的范围时,转换的行为方式。它仅适用于float 8转换(float8e4m3fn, float8e4m3fnuz, float8e5m2, float8e5m2fnuz)。默认情况下为true。有关更多详细信息,请参阅操作符Cast的描述。

输入

  • 输入 (异构) - T1:

    要转换的输入张量。

  • target_type (异构) - T2:

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

输出

  • 输出 (异构) - 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

  • function: True

  • support_level: SupportType.COMMON

  • 形状推断: True

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

总结

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

属性

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

    该参数定义了当输入值超出目标类型的范围时,转换的行为方式。它仅适用于float 8转换(float8e4m3fn, float8e4m3fnuz, float8e5m2, float8e5m2fnuz)。默认情况下为true。有关更多详细信息,请参阅操作符Cast的描述。

输入

  • 输入 (异构) - T1:

    要转换的输入张量。

  • target_type (异构) - T2:

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

输出

  • 输出 (异构) - 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

  • since_version: 15

  • function: True

  • support_level: SupportType.COMMON

  • 形状推断: True

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

摘要

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

输入

  • 输入 (异构) - T1:

    要转换的输入张量。

  • target_type (异构) - T2:

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

输出

  • 输出 (异构) - 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) ):

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