Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[2.0] Precission loss when exporting a model from 2.0 #20420

Closed
Zha0q1 opened this issue Jul 7, 2021 · 1 comment · Fixed by #20421
Closed

[2.0] Precission loss when exporting a model from 2.0 #20420

Zha0q1 opened this issue Jul 7, 2021 · 1 comment · Fixed by #20421

Comments

@Zha0q1
Copy link
Contributor

Zha0q1 commented Jul 7, 2021

Here's a simple model which just has one operator:

    def forward(self, a):
        return a - 37.38088245350211

This model will export this symbol file:

{
  "nodes": [
    {
      "op": "null",
      "name": "data",
      "attrs": {"__profiler_scope__": "<unk>:"},
      "inputs": []
    },
    {
      "op": "_npi_subtract_scalar",
      "name": "node_0",
      "attrs": {
        "is_int": "0",
        "scalar": "37.3809"
      },
      "inputs": [[0, 0, 0]]
    }
  ],
  "arg_nodes": [0],
  "node_row_ptr": [0, 1, 2],
  "heads": [[1, 0, 0]],
  "attrs": {
    "is_np_shape": ["int", 1],
    "mxnet_version": ["int", 20000]
  }
}

as we can see here the scalar only has 4 digits precision after the decimal point.

@barry-jin
Copy link
Contributor

Good catch! will be fixed in #20421

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

Successfully merging a pull request may close this issue.

2 participants