Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Parameter Header in V2 API #3519

Closed
luotao1 opened this issue Aug 16, 2017 · 0 comments
Closed

Add Parameter Header in V2 API #3519

luotao1 opened this issue Aug 16, 2017 · 0 comments

Comments

@luotao1
Copy link
Contributor

luotao1 commented Aug 16, 2017

In v1 api, there is parameter header in paddle/parameter/Parameter.h

 struct Header {
    int32_t version;     // = 0, file format version
    uint32_t valueSize;  // = sizeof(real)
    uint64_t size;       // = getSize()
  };

While in v2 api, it directly writes f.write(struct.pack("IIQ", 0, 4, size)) in python/paddle/v2/parameters.py#L282

 def serialize(self, name, f):
        param = self.get(name)
        size = reduce(lambda a, b: a * b, param.shape)
        f.write(struct.pack("IIQ", 0, 4, size))

Thus, we can't use version to distinguish different parameters: such as mkldnn parameters and paddle parameters. So, we should add the parameter header in V2 api too.

related with #3409

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant