Skip to content

np.mean(DenseMatrix, axis=n) gives a malformed DenseMatrix #5

Description

@rspeer

np.mean() of a DenseMatrix, across one axis, should return a DenseVector of the means. Instead, it returns a DenseMatrix wrapping a vector, which is just all kinds of bad.

Fixing this will require either (a) digging into the subclass magic, or (b) making DenseMatrix and DenseVector actually the same class.

Workaround: run np.asarray() on it first.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions