finch-tensor / finch-tensor-python

Sparse and Structured Tensor Programming in Python
MIT License
8 stars 3 forks source link

`Storage` object comparison operator #67

Closed hameerabbasi closed 4 months ago

hameerabbasi commented 4 months ago
          But we don't really have a string representation of a format or a format property in the `Tensor` class. So there's no way checking if the current format is e.g. `csf` and I would prefer to avoid parsing Julia's `_obj` repr if it matches some regex - it appears counterproductive to me.

_Originally posted by @mtsokol in https://github.com/willow-ahrens/finch-tensor/pull/45#discussion_r1629339973_

willow-ahrens commented 4 months ago

We could recursively walk the levels creating copies and error if we reach a level where the formats don't match. Even if we had a string format thing, we would still need to recurse down the levels to do the copy.

willow-ahrens commented 4 months ago

Perhaps typeof should suffice

willow-ahrens commented 4 months ago

I think this is a dup of https://github.com/willow-ahrens/finch-tensor/issues/13, and for now we can use typeof until we merge https://github.com/willow-ahrens/finch-tensor/pull/19