Skip to content

Impossible to compile DQNAgent outside of crate #24

@stiff

Description

@stiff

When crate rl is added via cargo, implementing ToTensor compiler gives error:

error[E0210]: type parameter `B` must be used as the type parameter for some local type (e.g., `MyStruct<B>`)
  --> src/main.rs:29:6
   |
29 | impl<B: Backend<IntElem = i32>> ToTensor<B, 2, Int> for Vec<HAction> {
   |      ^ type parameter `B` must be used as the type parameter for some local type
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter

Or am I missing something?

Version: 0.4.0
Agent is basically from dqn cart pole example, just stripped away gym and viz (to localize error).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions