pylibcugraphops.operators.agg_concat_weighted_n2n_bwd#

pylibcugraphops.operators.agg_concat_weighted_n2n_bwd = <nanobind.nb_func object>#
Computes the backward pass for a weighted aggregation (agg_weighted) using node features in an

node-to-node reduction (n2n). The reduction operates on a graph and each incoming message is weighted according to its edge weight and concatenates the input node embedding to the result.

agg_concat_weighted_n2n_bwd(grad_input: device array, grad_edge_weight: Optional[device array],
    grad_output: device array, edge_weight: device array, input_embedding: device array,
    graph: pylibcugraphops.csc_int[32|64],
    aggregation_operation: pylibcugraphops.operators.AggOp = pylibcugraphops.operators.AggOp.Sum,
    output_embedding: Optional[device array] = None, output_extrema_location: Optional[device array] = None,
    node_degree: Optional[device array], stream_id: int = 0
) -> None
Parameters:
grad_inputdevice array type

Device array containing the output gradient on input embeddings of forward. Shape: (graph.n_dst_nodes, dim_in).

grad_edge_weightdevice array type | None

Device array containing the output gradient on edge weights. If None, this is not calculated. If both this and grad_input are None, no calculation is performed. Shape: (n_edges, ).

grad_outputdevice array type

Device array containing the input gradient on output embeddings of forward. Shape: (graph.n_dst_nodes, 2 * dim_in).

edge_weight: device array type

Device array containing the edge weights. Shape: (n_edges, ).

input_embeddingdevice array type

Device array containing the input node embeddings. Shape: (graph.n_dst_nodes, dim_in).

graphopaque graph type

The graph used for the operation.

aggregation_operationAggOp, default=AggOp.Sum

The kind of aggregation operation.

output_embeddingdevice array type | None

Device array containing the output node embeddings, only required for AggOp.Mean, can be None otherwise. Shape: (graph.n_dst_nodes, 2 * dim_in).

output_extrema_locationdevice array type | None

Device array containing the location of the min/max embeddings. This is required for min/max aggregation only, and can be None otherwise. Shape: (graph.n_dst_nodes, dim_in) if set.

node_degreedevice array type | None

Device array containing the in-node degree, i.e. the sum of incoming weights. This is required for mean aggregation only, and can be None otherwise. Shape: (graph.n_dst_nodes, ) if set.

stream_idint, default=0

CUDA stream pointer as a python int.