Skip to content

Comment in StructuredDot.grad is not correct #1871

@tomicapretto

Description

@tomicapretto

Description

The following comment is not correct:

def grad(self, inputs, gout):
# a is sparse, b is dense, g_out is dense
# ga = g_out x b.T
# gb = a.T x g_out
(a, b) = inputs
(g_out,) = gout
return [structured_dot_grad(a, b, g_out), structured_dot(a.T, g_out)]

because b and g_out could be sparse, too.

However, they are not supported when performing the operation via C code, only via Python (and soon via numba as well).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions