array
Structs
Struct: Array
Array is the primary data structure in the autograd engine. It serves as a wrapper around the Node struct, which encapsulates the array’s data, shape, gradients, and other metadata.
Fields
-
node
:ArcPointer[Node]
Methods
__init__(out self, shape: List[Int], requires_grad: Bool = False, is_complex: Bool = False)
more details
__init__(out self, array_shape: ArrayShape, is_view: Bool = False)
__init__(out self, node: ArcPointer[Node])
__init__(out self, input_string: String, requires_grad: Bool = False)
__copyinit__(out self, other: Self)
__moveinit__(out self, owned other: Self)
__getitem__(self, *slices: Slice) -> Self
__setitem__(mut self, *slices: Slice, *, value: Variant[SIMD[float32, 1], Array])
__neg__(self) -> Self
__lt__(self, other: Self) -> Bool
__lt__(self, other: SIMD[float32, 1]) -> Bool
__le__(self, other: Self) -> Bool
__le__(self, other: SIMD[float32, 1]) -> Bool
__eq__(self, other: Self) -> Bool
__eq__(self, other: SIMD[float32, 1]) -> Bool
__ne__(self, other: Self) -> Bool
__ne__(self, other: SIMD[float32, 1]) -> Bool
__gt__(self, other: Self) -> Bool
__gt__(self, other: SIMD[float32, 1]) -> Bool
__ge__(self, other: Self) -> Bool
__ge__(self, other: SIMD[float32, 1]) -> Bool
__add__(self, other: Self) -> Self
__add__(self, other: SIMD[float32, 1]) -> Self
__sub__(self, other: Self) -> Self
__sub__(self, other: SIMD[float32, 1]) -> Self
__mul__(self, other: Self) -> Self
__mul__(self, other: SIMD[float32, 1]) -> Self
__matmul__(self, other: Self) -> Self
__truediv__(self, other: Self) -> Self
__truediv__(self, other: SIMD[float32, 1]) -> Self
__pow__(self, other: Self) -> Self
__pow__(self, other: SIMD[float32, 1]) -> Self
__radd__(self, other: Self) -> Self
__radd__(self, other: SIMD[float32, 1]) -> Self
__rsub__(self, other: Self) -> Self
__rsub__(self, other: SIMD[float32, 1]) -> Self
__rmul__(self, other: Self) -> Self
__rmul__(self, other: SIMD[float32, 1]) -> Self
__rmatmul__(self, other: Self) -> Self
__rtruediv__(self, other: Self) -> Self
__rtruediv__(self, other: SIMD[float32, 1]) -> Self
__rpow__(self, other: Self) -> Self
__rpow__(self, other: SIMD[float32, 1]) -> Self
__iadd__(mut self, other: Self)
__iadd__(mut self, other: SIMD[float32, 1])
__isub__(mut self, other: Self)
__isub__(mut self, other: SIMD[float32, 1])
__imul__(mut self, other: Self)
__imul__(mut self, other: SIMD[float32, 1])
__itruediv__(mut self, other: Self)
__itruediv__(mut self, other: SIMD[float32, 1])
__ipow__(mut self, other: Self)
__ipow__(mut self, other: SIMD[float32, 1])
id(self) -> Int
id_(mut self, id: Int)
array_shape(self) -> ArrayShape
array_shape_(mut self, shape: ArrayShape)
is_computed(self) -> Bool
is_computed_(mut self, is_computed: Bool)
is_graph_node_computed(self) -> Bool
is_graph_node_computed_(mut self, is_computed: Bool)
postpone_as_grpah_output(mut self)
args(self) -> List[Array]
args_(mut self, args: List[Array])
clear_args(mut self)
remove_grad(mut self)
kwargs(self) -> List[Array]
kwargs_(mut self, kwargs: List[Array])
id_in_graph_(mut self, id_in_graph: Int)
id_in_graph(self) -> Int
graph(self) -> ArcPointer[FxGraph]
data_(mut self, owned data_ptr: UnsafePointer[SIMD[float32, 1]])
graph_(mut self, graph: ArcPointer[FxGraph])
has_fxgraph(self) -> Bool
is_breakpoint(self) -> Bool
is_breakpoint_(mut self, is_breakpoint: Bool)
item(self, idx: Int) -> Self
setup_array_shape(mut self, array_shape: ArrayShape)
uew(self) -> List[fn(SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]) -> Tuple[SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]]]
more details
bew(self) -> List[fn(SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]) -> Tuple[SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]]]
more details
Args
self
:Self
Returns
List[fn(SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]) -> Tuple[SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]]]
inplace_infos(self) -> List[InplaceInfo]
append_arg(mut self, arg: Self)
append_inplace_info(mut self, inplace_info: InplaceInfo)
append_uew(mut self, uew: fn(SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]) -> Tuple[SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]])
more details
append_bew(mut self, bew: fn(SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]) -> Tuple[SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]])
more details
Args
-
self
:Self
-
bew
:fn(SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]) -> Tuple[SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)], SIMD[float32, nelts[::DType]().__mul__(2).__floordiv__(2)]]
shape(self) -> List[Int]
shape_(mut self, shape: List[Int])
stride_(mut self, stride: List[Int])
stride(self) -> List[Int]
storage_offset(self) -> Int
storage_offset_(mut self, storage_offset: Int)
ndim(self) -> Int
size(self) -> Int
is_view(self) -> Bool
is_view_(mut self, is_view: Bool)
base_(mut self, base: Self)
base(self) -> Self
requires_grad(self) -> Bool
requires_grad_(mut self, requires_grad: Bool)
meta_data(self) -> List[Int]
meta_data_(mut self, meta_data: List[Int])
has_real(self) -> Bool
has_real_(mut self, has_real: Bool)
has_imag(self) -> Bool
has_imag_(mut self, has_imag: Bool)
is_complex(self) -> Bool
is_complex_(mut self, is_complex: Bool)
data(self) -> UnsafePointer[SIMD[float32, 1]]
real_idx(self, idx: Int) -> Int
imag_idx(self, idx: Int) -> Int
load[width: Int = 1](self, idx: Int) -> SIMD[float32, width]
store[width: Int = 1](mut self, idx: Int, data: SIMD[float32, width])
load_imag[width: Int = 1](self, idx: Int) -> SIMD[float32, width]
store_imag[width: Int = 1](mut self, idx: Int, data: SIMD[float32, width])
load_complex[width: Int = 1](self, idx: Int) -> Tuple[SIMD[float32, 2.__mul__(width).__floordiv__(2)], SIMD[float32, 2.__mul__(width).__floordiv__(2)]]
more details
store_complex[width: Int = 1](mut self, idx: Int, real: SIMD[float32, width], imag: SIMD[float32, width])
compute_jvp(self) -> Bool
set_compute_jvp(mut self, compute_jvp: Bool)
set_fwd(mut self, fwd: fn(mut Array, List[Array]) raises -> None)
fwd(self) -> fn(mut Array, List[Array]) raises -> None
jvp_(mut self, jvp: fn(List[Array], List[Array]) raises -> Array)
jvp(self) -> fn(List[Array], List[Array]) raises -> Array
vjp_(mut self, vjp: fn(List[Array], Array, Array) raises -> List[Array])
vjp(self) -> fn(List[Array], Array, Array) raises -> List[Array]
has_grad(self) -> Bool
grad_(mut self, grad: Self)
grad(self) -> Self
set_name(mut self, name: String)
name(self) -> String
execute_fwd(mut self)
__str__(self) -> String
write_to[W: Writer](self, mut writer: W)
execute_fwds(mut self)
graph_dual(self) -> Self
backward(self, create_graph: Bool = False)
zero_grad(mut self)
T(self) -> Self
reshape(self, shape: List[Int]) -> Self
Functions
default_fwd
default_fwd(mut curr: Array, args: List[Array])
default_vjp
default_vjp(primals: List[Array], grad: Array, out: Array) -> List[Array]
default_jvp
default_jvp(primals: List[Array], tangents: List[Array]) -> Array
Last updated on