jax.numpy.isdtype#

jax.numpy.isdtype(dtype, kind)[原始碼]#

返回布林值,指示提供的 dtype 是否為指定的種類。

參數:
  • dtype (DTypeLike) – 輸入 dtype

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

    資料型別種類。如果 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