jax.lax.bitcast_convert_type

jax.lax.bitcast_convert_type(operand, new_dtype)[source]

Elementwise bitcast.

Wraps XLA’s BitcastConvertType operator, which performs a bit cast from one type to another. The bitwidth of the source and destination types must match.

Parameters
  • operand (Any) – an array or scalar value to be cast

  • new_dtype (Any) – the new type. Should be a NumPy type.

Return type

Any

Returns

An array with the same shape as operand, bitcast elementwise to new_dtype.