pub struct BFloat16Type {}Expand description
The bfloat16 data type
This implements the ArrowFloatType trait for bfloat16 values.
Trait Implementations§
Source§impl ArrowFloatType for BFloat16Type
impl ArrowFloatType for BFloat16Type
const FLOAT_TYPE: FloatType = FloatType::BFloat16
const MIN: Self::Native = bf16::MIN
const MAX: Self::Native = bf16::MAX
type Native = bf16
Source§type ArrayType = FixedSizeBinaryArray
type ArrayType = FixedSizeBinaryArray
Arrow Float Array Type.
Source§fn empty_array() -> Self::ArrayType
fn empty_array() -> Self::ArrayType
Returns empty array of this type.
Source§impl Debug for BFloat16Type
impl Debug for BFloat16Type
Source§impl FloatArray<BFloat16Type> for FixedSizeBinaryArray
impl FloatArray<BFloat16Type> for FixedSizeBinaryArray
Source§fn as_slice(&self) -> &[bf16]
fn as_slice(&self) -> &[bf16]
Returns the underlying bf16 values as a borrowed slice.
§Preconditions
value_length()must be 2 (theFixedSizeBinary(2)storage shape used byBFloat16Array). Asserted at entry.- The value buffer must be at least 2-byte aligned. Lance’s in-tree
constructors always satisfy this: value buffers are built either via
MutableBuffer(aligned to arrow-buffer’sALIGNMENTconstant, ≥32 bytes) or viaBuffer::from_vec::<u16>(aligned toalign_of::<u16>()== 2); both meetbf16’s 2-byte requirement. Externally-builtFixedSizeBinaryArrays arriving via FFI, IPC, orBuffer::from_custom_allocationare not required by arrow-rs to be aligned beyond a single byte; passing one to this method violates the precondition. Adebug_assertbelow catches such inputs in debug and test builds.
§Endianness
lance-arrow is gated on target_endian = "little" at the crate root,
so this method always returns values in the same byte order Lance writes
(see BFloat16Array::value and the FromIterator impls).
type FloatType = BFloat16Type
Source§fn from_values(values: Vec<bf16>) -> Self
fn from_values(values: Vec<bf16>) -> Self
Construct an array from a vector of values.
Source§fn from_iter_values(values: impl IntoIterator<Item = T::Native>) -> Selfwhere
Self: Sized,
fn from_iter_values(values: impl IntoIterator<Item = T::Native>) -> Selfwhere
Self: Sized,
Construct an array from an iterator of values.
Auto Trait Implementations§
impl Freeze for BFloat16Type
impl RefUnwindSafe for BFloat16Type
impl Send for BFloat16Type
impl Sync for BFloat16Type
impl Unpin for BFloat16Type
impl UnsafeUnpin for BFloat16Type
impl UnwindSafe for BFloat16Type
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more