jax.numpy.isdtype#

jax.numpy.isdtype(dtype, kind)[源代码]#

返回一个布尔值,指示提供的 dtype 是否为指定的 kind。

参数:
  • dtype (DTypeLike) – 输入的 dtype

  • kind (str | DTypeLike | tuple[str | DTypeLike, ...]) –

    数据类型 kind。如果 kind 是 dtype 形式,则返回 dtype = kind。如果 kind 是字符串,则如果 dtype 属于指定类别,则返回 True

    • 'bool': {bool}

    • 'signed integer': {int4, int8, int16, int32, int64}

    • 'unsigned integer': {uint4, uint8, uint16, uint32, uint64}

    • 'integral': ('signed integer', 'unsigned integer') 的简写

    • 'real floating': {float8_*, float16, bfloat16, float32, float64}

    • 'complex floating': {complex64, complex128}

    • 'numeric': ('integral', 'real floating', 'complex floating') 的简写

    如果 kind 是元组,则当 dtype 匹配元组中的任何项时返回 True。

返回:

True 或 False

返回类型:

bool