def symbolic(g, x, weight, l2NormParams): return g.op(add_domain("Normalize"), x, weight, eps_f=l2NormParams.eps, across_spatial_i=l2NormParams.across_spatial, channel_shared_i=l2NormParams.channel_shared)
def symbolic(g, x): zero = g.constant(0, [1], 'float') zero = g.op("Unsqueeze", zero, axes_i=[1, 2, 3]) scale = g.op("Abs", x) scale = g.op("ReduceMean", scale, axes_i=[0, 1, 2, 3]) scale_neg = g.op("Neg", scale) return g.op(add_domain("FakeQuantize"), x, zero, zero, scale_neg, scale, levels_i=2)
def symbolic(g, input_fm, img_tensor, priorbox_params): return g.op(add_domain("PriorBox"), input_fm, img_tensor, min_size_f=[priorbox_params.min_size], max_size_f=[priorbox_params.max_size], aspect_ratio_f=priorbox_params.aspect_ratio, flip_i=priorbox_params.flip, clip_i=priorbox_params.clip, variance_f=priorbox_params.variance, step_f=priorbox_params.step, offset_f=priorbox_params.offset, step_h_f=priorbox_params.step_h, step_w_f=priorbox_params.step_w, img_size_i=priorbox_params.img_size, img_h_i=priorbox_params.img_h, img_w_i=priorbox_params.img_w)
def symbolic(g, input_, levels, input_low, input_high, output_low, output_high): return g.op(add_domain("FakeQuantize"), input_, input_low, input_high, output_low, output_high, levels_i=levels)
def symbolic(g, x, scale, threshold): zero = g.constant(0, [1], 'float') zero = g.op("Unsqueeze", zero, axes_i=[0, 2, 3]) threshold = g.op("Mul", threshold, scale) scale = g.op("Unsqueeze", scale, axes_i=[0, 2, 3]) return g.op(add_domain("FakeQuantize"), x, threshold, threshold, zero, scale, levels_i=2)