+
Skip to content

Add HasArrayData to GradientProvider #260

@coreylowman

Description

@coreylowman

First mentioned in #99.

In order to access parameter data for optimizers, the parameters need to have HasArrayData added:

    fn gradient<P>(&mut self, p: &P) -> Option<Box<P::Array>>
    where
-        P: HasUniqueId + HasArrayType<Dtype = f32> + HasDevice;
+        P: HasUniqueId + HasArrayType<Dtype = f32> + HasDevice + HasArrayData;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载