Procedures

ProcedureLocationProcedure TypeDescription
abs diffstruc__operations_maths Interface
accumulate_gradient_ptr diffstruc__types_submodule Subroutine

Accumulate gradient for array with safe memory management

accumulate_gradient_samples diffstruc__types_submodule Subroutine

Accumulate gradient for array - optimized with fused direction+accumulate

accumulate_gradient_single diffstruc__types_submodule Subroutine

Accumulate gradient for array - optimized with sum-reduced path When a sum-reduced partial derivative is available, computes the sum(partial, dim=2) directly, avoiding the large (n_elem, S) allocation. Falls back to full computation when sum-reduced variant is not set.

add_arrays diffstruc__types Interface
add_real1d diffstruc__types Interface
add_real2d diffstruc__types Interface
add_scalar diffstruc__types Interface
allocate_array diffstruc__types Interface
array_type diffstruc__types Interface
assign_and_deallocate_source diffstruc__types Interface
assign_array diffstruc__types Interface
assign_shallow diffstruc__types Interface
concat diffstruc__operations_broadcast Interface
cos diffstruc__operations_trig Interface
cos_array diffstruc__operations_trig Function

Cosine function for autodiff arrays

create_result_array diffstruc__types Interface
cubed diffstruc__operations_maths Interface
dealloc_list_append diffstruc__types_submodule Subroutine

Append pointer to dealloc list using count-based tracking (O(1) amortized)

deallocate_array diffstruc__types Interface
detach diffstruc__types Interface
divide_arrays diffstruc__types Interface
divide_real1d diffstruc__types Interface
divide_scalar diffstruc__types Interface
dot_product diffstruc__operations_linalg Interface
double_map_add diffstruc__types_submodule Subroutine

Add pointer pair to double-array map (grow if needed)

duplicate_graph diffstruc__types Interface
duplicate_pointer diffstruc__types_submodule Function
exp diffstruc__types Interface
extract_array diffstruc__types Interface
finalise_array diffstruc__types Interface
flatten_array diffstruc__types Interface
forward_over_reverse diffstruc__types_submodule Function
gaussian diffstruc__operations_maths Interface
ge_scalar diffstruc__operations_comparison Function

Greater than or equal to comparison between autodiff array and scalar

get_partial diffstruc__types Interface
get_partial_abs diffstruc__operations_maths_sub Function
get_partial_abs_val diffstruc__operations_maths_sub Subroutine
get_partial_add diffstruc__types_submodule Function

Get partial derivative with respect to left operand

get_partial_add_val diffstruc__types_submodule Subroutine
get_partial_add_val_sum diffstruc__types_submodule Subroutine

Fused partial+sum for add: output(:,1) = sum_over_samples(upstream_grad)

get_partial_concat_left diffstruc__operations_broadcast_sub Function
get_partial_concat_left_val diffstruc__operations_broadcast_sub Subroutine
get_partial_concat_right diffstruc__operations_broadcast_sub Function
get_partial_concat_right_val diffstruc__operations_broadcast_sub Subroutine
get_partial_cos diffstruc__operations_trig Function
get_partial_cos_val diffstruc__operations_trig Subroutine
get_partial_cubed diffstruc__operations_maths_sub Function
get_partial_cubed_val diffstruc__operations_maths_sub Subroutine
get_partial_divide_left diffstruc__types_submodule Function

Get partial derivative with respect to left operand

get_partial_divide_left_val diffstruc__types_submodule Subroutine
get_partial_divide_right diffstruc__types_submodule Function

Get partial derivative with respect to right operand

get_partial_divide_right_val diffstruc__types_submodule Subroutine
get_partial_dot_product_left diffstruc__operations_linalg_sub Function
get_partial_dot_product_left_val diffstruc__operations_linalg_sub Subroutine
get_partial_dot_product_right diffstruc__operations_linalg_sub Function
get_partial_dot_product_right_val diffstruc__operations_linalg_sub Subroutine
get_partial_exp diffstruc__types_submodule Function

Get partial derivative with respect to left operand

get_partial_exp_val diffstruc__types_submodule Subroutine
get_partial_exp_val_sum diffstruc__types_submodule Subroutine

Fused partial+sum for exp: output(:,1) = sum_s(upstream * exp(x))

get_partial_gaussian diffstruc__operations_maths_sub Function
get_partial_gaussian_val diffstruc__operations_maths_sub Subroutine
get_partial_index diffstruc__operations_broadcast_sub Function
get_partial_log diffstruc__types_submodule Function
get_partial_log10 diffstruc__operations_maths_sub Function
get_partial_log10_val diffstruc__operations_maths_sub Subroutine
get_partial_log_val diffstruc__types_submodule Subroutine
get_partial_matmul_left diffstruc__operations_linalg_sub Function

Get partial derivative with respect to left operand of matmul

get_partial_matmul_left_val diffstruc__operations_linalg_sub Subroutine

Compute gradient w.r.t. left operand for matmul in reverse mode.

Read more…
get_partial_matmul_left_val_sum diffstruc__operations_linalg_sub Subroutine

Sum-reduced gradient w.r.t. left operand for matmul. For the outer product case (rank-1 right operand), this computes: output = sum_s(upstream(:,s) (x) right(:,s)) = upstream * right^T using a single SGEMM call instead of computing the full (n_elem, S) array.

get_partial_matmul_right diffstruc__operations_linalg_sub Function

Get partial derivative with respect to right operand of matmul

get_partial_matmul_right_val diffstruc__operations_linalg_sub Subroutine

Compute gradient w.r.t. right operand for matmul in reverse mode.

Read more…
get_partial_matmul_right_val_sum diffstruc__operations_linalg_sub Subroutine

Sum-reduced gradient w.r.t. right operand for matmul. For the outer product case (rank-1 left operand), this computes: output = sum_s(left(:,s) (x) upstream(:,s)) = left * upstream^T using a single SGEMM call.

get_partial_max_left diffstruc__operations_reduction Function
get_partial_max_left_val diffstruc__operations_reduction Subroutine
get_partial_max_right diffstruc__operations_reduction Function
get_partial_max_right_val diffstruc__operations_reduction Subroutine
get_partial_mean diffstruc__types_submodule Function
get_partial_mean_all diffstruc__types_submodule Function
get_partial_mean_all_val diffstruc__types_submodule Subroutine
get_partial_mean_val diffstruc__types_submodule Subroutine
get_partial_merge_left diffstruc__operations_comparison Function
get_partial_merge_left_val diffstruc__operations_comparison Subroutine
get_partial_merge_right diffstruc__operations_comparison Function
get_partial_merge_right_val diffstruc__operations_comparison Subroutine
get_partial_multiply_left diffstruc__types_submodule Function

Get partial derivative with respect to left operand

get_partial_multiply_left_val diffstruc__types_submodule Subroutine
get_partial_multiply_left_val_sum diffstruc__types_submodule Subroutine

Fused partial+sum for multiply left: output(:,1) = sum_s(upstream*right_op)

get_partial_multiply_logical_left diffstruc__types_submodule Function
get_partial_multiply_logical_left_val diffstruc__types_submodule Subroutine
get_partial_multiply_right diffstruc__types_submodule Function

Get partial derivative with respect to right operand

get_partial_multiply_right_val diffstruc__types_submodule Subroutine
get_partial_multiply_right_val_sum diffstruc__types_submodule Subroutine

Fused partial+sum for multiply right: output(:,1) = sum_s(upstream*left_op)

get_partial_negate diffstruc__types_submodule Function

Get partial derivative with respect to left operand

get_partial_negate_val diffstruc__types_submodule Subroutine
get_partial_negate_val_sum diffstruc__types_submodule Subroutine

Fused partial+sum for negate: output(:,1) = -sum_over_samples(upstream_grad)

get_partial_outer_product_left diffstruc__operations_linalg_sub Function
get_partial_outer_product_right diffstruc__operations_linalg_sub Function
get_partial_pack_indices diffstruc__operations_broadcast_sub Function
get_partial_pack_indices_val diffstruc__operations_broadcast_sub Subroutine
get_partial_pack_mask diffstruc__operations_broadcast_sub Function
get_partial_pack_mask_val diffstruc__operations_broadcast_sub Subroutine
get_partial_power_base diffstruc__types_submodule Function

Get the partial gradient with respect to the base of the power operation

get_partial_power_base_val diffstruc__types_submodule Subroutine
get_partial_power_base_val_sum diffstruc__types_submodule Subroutine

Fused partial+sum for power base: output(:,1) = sum_s(d(a^n)/da * upstream)

get_partial_power_exponent diffstruc__types_submodule Function

Get the partial gradient with respect to the exponent of the power operation

get_partial_reshape diffstruc__operations_broadcast_sub Function
get_partial_reshape_val diffstruc__operations_broadcast_sub Subroutine
get_partial_sigmoid diffstruc__operations_maths_sub Function
get_partial_sigmoid_val diffstruc__operations_maths_sub Subroutine
get_partial_sin diffstruc__operations_trig Function
get_partial_sin_val diffstruc__operations_trig Subroutine
get_partial_spread diffstruc__types_submodule Function
get_partial_sqrt diffstruc__operations_maths_sub Function
get_partial_sqrt_val diffstruc__operations_maths_sub Subroutine
get_partial_squared diffstruc__operations_maths_sub Function
get_partial_squared_val diffstruc__operations_maths_sub Subroutine
get_partial_squared_val_sum diffstruc__operations_maths_sub Subroutine

Fused partial+sum for squared: output(:,1) = sum_s(upstream * left_op * 2)

get_partial_sum diffstruc__types_submodule Function
get_partial_sum_all diffstruc__types_submodule Function
get_partial_sum_all_val diffstruc__types_submodule Subroutine
get_partial_sum_all_val_sum diffstruc__types_submodule Subroutine

Fused partial+sum for sum_all: output(:,1) = upstream_grad(1,1)*num_samples

get_partial_sum_and_pad diffstruc__types_submodule Function
get_partial_sum_and_pad_val diffstruc__types_submodule Subroutine
get_partial_sum_val diffstruc__types_submodule Subroutine
get_partial_sum_val_sum diffstruc__types_submodule Subroutine

Fused partial+sum for sum: output(:,1) = sum_s(spread(upstream_grad))

get_partial_tan diffstruc__operations_trig Function
get_partial_tan_val diffstruc__operations_trig Subroutine
get_partial_tanh diffstruc__operations_hyp Function
get_partial_tanh_reverse diffstruc__operations_hyp Function
get_partial_tanh_reverse_val diffstruc__operations_hyp Subroutine
get_partial_tanh_val diffstruc__operations_hyp Subroutine
get_partial_tanh_val_sum diffstruc__operations_hyp Subroutine

Fused partial+sum for tanh: output(:,1) = sum_s(upstream * (1 - val^2))

get_partial_transpose_left diffstruc__operations_linalg_sub Function
get_partial_unpack_indices diffstruc__operations_broadcast_sub Function
get_partial_unpack_mask diffstruc__operations_broadcast_sub Function
get_partial_unspread diffstruc__types_submodule Function
get_partial_val diffstruc__types Interface
get_partial_val_sum diffstruc__types Interface
get_ptr_from_id diffstruc__types Interface
grad_forward diffstruc__types Interface
grad_reverse diffstruc__types Interface
gt_scalar diffstruc__operations_comparison Function

Greater than comparison between autodiff array and scalar

le_scalar diffstruc__operations_comparison Function

Less than or equal tocomparison between autodiff array and scalar

log diffstruc__types Interface
log10 diffstruc__operations_maths Interface
lt_scalar diffstruc__operations_comparison Function

Less than comparison between autodiff array and scalar

ltrim diffstruc__operations_broadcast Interface
map_find diffstruc__types_submodule Function

Check if target pointer exists in single-array map

map_free diffstruc__types_submodule Subroutine

Free array map (nullify pointers and deallocate array)

matmul diffstruc__operations_linalg Interface
max diffstruc__operations_reduction Interface
max_array diffstruc__operations_reduction Function

Find maximum value between two autodiff arrays

max_scalar diffstruc__operations_reduction Function

Find maximum value between an autodiff array and a scalar

maxval diffstruc__operations_reduction Interface
maxval_array diffstruc__operations_reduction Function

Find maximum value along a dimension

mean diffstruc__types Interface
merge diffstruc__operations_comparison Interface
merge_array diffstruc__operations_comparison Function

Merge two autodiff arrays based on a mask

merge_real2d diffstruc__operations_comparison Function

Merge two autodiff arrays based on a mask

merge_scalar diffstruc__operations_comparison Function

Merge two autodiff arrays based on a mask

multiply_arrays diffstruc__types Interface
multiply_logical diffstruc__types Interface
multiply_real2d diffstruc__types Interface
multiply_scalar diffstruc__types Interface
negate_array diffstruc__types Interface
nullify_graph diffstruc__types Interface
nullify_graph_recursive diffstruc__types_submodule Subroutine

Recursive helper using visit_tag for O(1) cycle detection Collects nodes to deallocate in a second pass

operator(*) diffstruc__types Interface
operator(**) diffstruc__types Interface
operator(+) diffstruc__types Interface
operator(-) diffstruc__types Interface
operator(.dot.) diffstruc__operations_linalg Interface
operator(.ge.) diffstruc__operations_comparison Interface
operator(.gt.) diffstruc__operations_comparison Interface
operator(.index.) diffstruc__operations_broadcast Interface
operator(.le.) diffstruc__operations_comparison Interface
operator(.lt.) diffstruc__operations_comparison Interface
operator(.mmul.) diffstruc__operations_linalg Interface
operator(.outer.) diffstruc__operations_linalg Interface
operator(/) diffstruc__types Interface
outer_product diffstruc__operations_linalg Interface
pack diffstruc__operations_broadcast Interface
power_arrays diffstruc__types Interface
power_int_scalar diffstruc__types Interface
power_real_scalar diffstruc__types Interface
print_graph diffstruc__types Interface
reset_graph diffstruc__types Interface
reset_graph_inner diffstruc__types_submodule Subroutine
reshape diffstruc__operations_broadcast Interface
reverse_index diffstruc__operations_broadcast Interface
reverse_mode diffstruc__types_submodule Subroutine

Backward operation for arrays

reverse_mode_ptr diffstruc__types_submodule Subroutine

Backward operation for arrays

rtrim diffstruc__operations_broadcast Interface
scalar_merge diffstruc__operations_comparison Function

Merge two autodiff arrays based on a mask

set_array diffstruc__types Interface
set_direction diffstruc__types Interface
set_requires_grad diffstruc__types Interface
sgemm diffstruc__operations_linalg_sub Interface
sgemv diffstruc__operations_linalg_sub Interface
sigmoid diffstruc__operations_maths Interface
sign diffstruc__operations_maths Interface
sin diffstruc__operations_trig Interface
sin_array diffstruc__operations_trig Function

Sine function for autodiff arrays

single_map_add diffstruc__types_submodule Subroutine

Add pointer to single-array map (grow if needed)

slice_left diffstruc__operations_broadcast Interface
slice_right diffstruc__operations_broadcast Interface
spread diffstruc__types Interface
sqrt diffstruc__operations_maths Interface
squared diffstruc__operations_maths Interface
subtract_arrays diffstruc__types Interface
subtract_real1d diffstruc__types Interface
subtract_real2d diffstruc__types Interface
subtract_scalar diffstruc__types Interface
sum diffstruc__types Interface
tan diffstruc__operations_trig Interface
tan_array diffstruc__operations_trig Function

Tangent function for autodiff arrays

tanh diffstruc__operations_hyp Interface
tanh_array diffstruc__operations_hyp Function

Hyperbolic tangent function for autodiff arrays

tanh_reverse_array diffstruc__operations_hyp Function

Reverse mode for tanh function

transpose diffstruc__operations_linalg Interface
unpack diffstruc__operations_broadcast Interface
unspread diffstruc__types Interface
zero_all_fixed_pointer_grads diffstruc__types_submodule Subroutine

Zero the gradients of all fixed-pointer nodes in the graph

zero_all_grads diffstruc__types Interface
zero_fixed_grads_inner diffstruc__types_submodule Subroutine
zero_grad diffstruc__types Interface