public void Infer(layers.Quantize layer, QuantizeLayerArgument argument, InferenceContext context) { var inputAlloc = context.MainMemoryMap[layer.Input.Connection.From]; var outputAlloc = context.MainMemoryMap[layer.Output]; argument.MainMemoryInputAddress = inputAlloc.GetAddress(); argument.MainMemoryOutputAddress = outputAlloc.GetAddress(); }
public QuantizeLayerArgument Convert(layers.Quantize layer, ConvertContext context) { return(new QuantizeLayerArgument { Count = (uint)layer.Input.Dimensions.GetSize(), QuantParam = context.Quantization.Distributions[layer.Output].Global.GetQuantizationParam(8) }); }