485e19e483e543fada5e64e50a9ab82cb6a91b24,src/graph_builder/backend/webgpu/meta_buffer_injector.py,MetaBufferInjector,generate_buffer,#MetaBufferInjector#,47

Before Change



        offset_map = {}
        offset = 0
        values = []
        for key, value in self.data.items():
            values += [value]
            offset_map[key] = offset
            offset += 1

After Change


            if isinstance(value, int):
                values += np.array([value], dtype=np.int32).tobytes()

            elif isinstance(value, float):
                values += np.array([value], dtype=np.float32).tobytes()

            elif isinstance(value, bytes):
                if len(value) % 4 != 0:
                    value += bytes(4 - (len(value) % 4))
                    
                values += value

            else:
                raise TypeError("MetaBufferInjector only supports int, float, or bytes contents.")

        self.offset_map = offset_map
        self.buffer = values
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: mil-tokyo/webdnn
Commit Name: 485e19e483e543fada5e64e50a9ab82cb6a91b24
Time: 2017-05-01
Author: y.kikura@gmail.com
File Name: src/graph_builder/backend/webgpu/meta_buffer_injector.py
Class Name: MetaBufferInjector
Method Name: generate_buffer


Project Name: bashtage/linearmodels
Commit Name: 773626e076b3eea517c38870561a2d6b3337a7ca
Time: 2020-01-19
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/iv/results.py
Class Name: IVResults
Method Name: _endogeneity_setup


Project Name: scikit-optimize/scikit-optimize
Commit Name: 44be9703a0744caf78b8b61319be0db281e91d6a
Time: 2018-04-06
Author: scott_graham@bose.com
File Name: skopt/space/space.py
Class Name: Space
Method Name: from_yaml