Giter Club home page Giter Club logo

Comments (4)

mratsim avatar mratsim commented on June 2, 2024

Edit: with debug output:

$User/.nimble/pkgs/nesm-0.3.1/nesm.nim(186, 9) Hint: TypeDef
  Sym "MNIST_imgs"
  Empty
  ObjectTy
    Empty
    Empty
    RecList
      IdentDefs
        Postfix
          Ident ident"*"
          Ident ident"magic_number"
        Sym "int32"
        Empty
      IdentDefs
        Postfix
          Ident ident"*"
          Ident ident"n_imgs"
        Sym "int32"
        Empty
      IdentDefs
        Postfix
          Ident ident"*"
          Ident ident"n_rows"
        Sym "int32"
        Empty
      IdentDefs
        Postfix
          Ident ident"*"
          Ident ident"n_cols"
        Sym "int32"
        Empty
      IdentDefs
        Postfix
          Ident ident"*"
          Ident ident"data"
        BracketExpr
          Sym "seq"
          Sym "uint8"
        Empty [User]
/Users/tesuji/.nimble/pkgs/nesm-0.3.1/nesm.nim(208, 9) Hint: TypeDef
  Sym "MNIST_imgs"
  Empty
  ObjectTy
    Empty
    Empty
    RecList
      IdentDefs
        Postfix
          Ident ident"*"
          Ident ident"magic_number"
        Sym "int32"
        Empty
      IdentDefs
        Postfix
          Ident ident"*"
          Ident ident"n_imgs"
        Sym "int32"
        Empty
      IdentDefs
        Postfix
          Ident ident"*"
          Ident ident"n_rows"
        Sym "int32"
        Empty
      IdentDefs
        Postfix
          Ident ident"*"
          Ident ident"n_cols"
        Sym "int32"
        Empty
      IdentDefs
        Postfix
          Ident ident"*"
          Ident ident"data"
        BracketExpr
          Sym "seq"
          Sym "uint8"
        Empty [User]
serialization_nesm.nim(10, 15) template/generic instantiation from here
/Users/tesuji/.nimble/pkgs/nesm-0.3.1/nesm/generator.nim(100, 10) Error: undeclared identifier: 'data'

from nesm.

xomachine avatar xomachine commented on June 2, 2024

Not related to the bug but it looks like the structure was not described in correct way. seq[uint8] reads the number of elements first and then reads elements themselves.
To serialize such a structure you need to use special pragma-like options {size: N} and {sizeof: N} from the devel branch. Examples can be found here and here.

from nesm.

xomachine avatar xomachine commented on June 2, 2024

I can not reproduce it on both of latest master or devel (aad2ce3 and 076639c) NESM branches with nim-lang/Nim@35133d9

Could you please provide the commit hash of the NESM version you are using?

from nesm.

mratsim avatar mratsim commented on June 2, 2024

It's the latest released version that doesn't work (v0.3.1), I build NESM from head and it works. So closing.

And thanks for the extra info on the structure.

from nesm.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.