elem: do not rely on torch if not present (!)
hash: added refcount support
elem: support for tds_hash type
hash: iterator retains hash