Skip to content

API to determine if a torch.return_type is a "structseq" #75982

@zou3519

Description

@zou3519

Motivation

A "structseq" is this weird Python-C API thing used to create namedtuple-like types from C++.

#75915 introduces some logic that ideally would grab all "structseq" classes from torch.return_types and register them as PyTree nodes. However, we didn't know how to actually check if something is a structseq or not (the documentation doesn't provide any helper functions for that).

If possible we should write an API that can check if a type is a "structseq" and then use it in #75915

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA request for a proper, new feature.triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions