pub struct ApproxExponent {
pub precision: u64,
}
Expand description
A structure that defines the custom operation ApproxExponent that computes an approximate exp(x / (2 ** precision)) * (2 ** precision) using piecewise-linear approximation.
So far this operation supports only INT64 scalar type.
§Custom operation arguments
- Node containing a signed 64-bit array or scalar to compute the exponent
§Custom operation returns
New ApproxExponent node
§Example
let c = create_context().unwrap();
let g = c.create_graph().unwrap();
let t = array_type(vec![3], INT64);
let x = g.input(t.clone()).unwrap();
let n = g.custom_op(CustomOperation::new(ApproxExponent {precision: 4}), vec![x]).unwrap();
Fields§
§precision: u64
Assume that we’re operating in fixed precision arithmetic with denominator 2 ** precision.
Trait Implementations§
Source§impl CustomOperationBody for ApproxExponent
impl CustomOperationBody for ApproxExponent
Source§impl Debug for ApproxExponent
impl Debug for ApproxExponent
Source§impl<'de> Deserialize<'de> for ApproxExponent
impl<'de> Deserialize<'de> for ApproxExponent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for ApproxExponent
impl Hash for ApproxExponent
Source§impl PartialEq for ApproxExponent
impl PartialEq for ApproxExponent
Source§impl Serialize for ApproxExponent
impl Serialize for ApproxExponent
impl Eq for ApproxExponent
impl StructuralPartialEq for ApproxExponent
Auto Trait Implementations§
impl Freeze for ApproxExponent
impl RefUnwindSafe for ApproxExponent
impl Send for ApproxExponent
impl Sync for ApproxExponent
impl Unpin for ApproxExponent
impl UnwindSafe for ApproxExponent
Blanket Implementations§
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.