这是indexloc提供的服务,不要输入任何密码
Skip to content

Clean up handling of output_dim #1024

@opcode81

Description

@opcode81
  • I have marked all applicable categories:
    • exception-raising bug
    • RL algorithm bug
    • documentation request (i.e. "X is missing from the documentation.")
    • new feature request
    • design request (i.e. "X should be changed to Y.")
  • I have visited the source website
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and environment, where applicable:
    import tianshou, gymnasium as gym, torch, numpy, sys
    print(tianshou.__version__, gym.__version__, torch.__version__, numpy.__version__, sys.version, sys.platform)

There are contrived mechanisms for the retrieval of the "output_dim" attribute of nn.Modules in several places (see usages of newly introduced function get_output_dim; there may be others). The clean way of handling this is to change the respective interfaces to a more specfic class that explicitly supports the retrieval of the output dimension. (The high-level API has already partly addressed this by adding corresponding methods to base classes.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactoringNo change to functionality

    Type

    No type

    Projects

    Status

    To do

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions