Пример #1
0
    def test_eltwise_mul(self):
        attrs = {}
        res = eltwise_ext(AttrDictionary(attrs),
                          infer=lambda a, b: a * b,
                          op_type="mul")
        exp_attrs = {'type': 'Eltwise', 'operation': 'mul'}

        for key in exp_attrs.keys():
            self.assertEqual(res[key], exp_attrs[key])
Пример #2
0
mxnet_op_extractors = {
    'BatchNorm':
    extractor_wrapper(batch_norm_ext),
    'Crop':
    extractor_wrapper(crop_ext),
    'ScaleShift':
    extractor_wrapper(scale_shift_ext),
    'slice_axis':
    extractor_wrapper(slice_axis_ext),
    'null':
    lambda node: null_ext(node.symbol_dict),
    'Concat':
    extractor_wrapper(concat_ext),
    'elemwise_add':
    extractor_wrapper(lambda attrs: eltwise_ext(
        attrs, infer=lambda a, b: a + b, op_type="sum")),
    'elemwise_mul':
    extractor_wrapper(lambda attrs: eltwise_ext(
        attrs, infer=lambda a, b: a * b, op_type="mul")),
    '_Plus':
    extractor_wrapper(lambda attrs: eltwise_ext(
        attrs, infer=lambda a, b: a + b, op_type="sum")),
    'FullyConnected':
    extractor_wrapper(fully_connected_ext),
    'transpose':
    extractor_wrapper(transpose_ext),
    'LRN':
    extractor_wrapper(lrn_ext),
    'L2Normalization':
    extractor_wrapper(l2_normalization_ext),
    '_contrib_MultiBoxPrior':