f2754e0656d8cebe1f785f6af100e4ade241a7f8,thinc/model.py,Model,from_bytes,#Model#Any#,556

Before Change


            for dim, value in data["dims"].items():
                layer.set_dim(dim, value)
            for param in data["params"]:
                layer.set_param(param["name"], param["value"])
            for i, shim_bytes in enumerate(data["shims"]):
                layer.shims[i].from_bytes(shim_bytes)
            for name, ref_i in data["refs"].items():
                if ref_i is None:

After Change


        if len(msg["nodes"]) != len(nodes):
            raise ValueError("Cannot deserialize model: mismatched structure.")
        for i, node in enumerate(nodes):
            info = msg["nodes"][i]
            node.name = info["name"]
            for dim, value in info["dims"].items():
                node.set_dim(dim, value)
            for ref, ref_index in info["refs"].items():
                if ref_index is None:
                    node.set_ref(ref, None)
                else:
                    node.set_ref(ref, nodes[ref_index])
            for attr, value in msg["attrs"][i].items():
                default_value = node.get_attr(attr)
                loaded_value = deserialize_attr(default_value, value, attr, node)
                node.set_attr(attr, loaded_value)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: explosion/thinc
Commit Name: f2754e0656d8cebe1f785f6af100e4ade241a7f8
Time: 2020-01-14
Author: honnibal+gh@gmail.com
File Name: thinc/model.py
Class Name: Model
Method Name: from_bytes


Project Name: explosion/thinc
Commit Name: f2754e0656d8cebe1f785f6af100e4ade241a7f8
Time: 2020-01-14
Author: honnibal+gh@gmail.com
File Name: thinc/model.py
Class Name: Model
Method Name: copy


Project Name: NifTK/NiftyNet
Commit Name: 65e9d15b684fadf68a71f1fdf2066eb40f10d9f8
Time: 2017-07-28
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/engine/application_driver.py
Class Name: ApplicationDriver
Method Name: initialise_application