def METHOD_NAME(self, name, shape: list = []):
    if name not in self.tensors:
        raise KeyError("Should addWeight first:{}!!!".format(name))
    old_shape = self.getShape(name)
    if shape and old_shape != shape:
        assert (np.prod(old_shape) == np.prod(shape))
        old_shape = shape
    ori_type = str(self.tensors[name].dtype)
    type_dict = {
        'int8': "INT8",
        'uint8': "UINT8",
        'float32': "F32",
        'int32': "INT32",
        'int16': "INT16",
        'uint16': "UINT16",
    }
    if ori_type not in type_dict:
        raise KeyError("type {} not implemented".format(ori_type))
    op = self.mlir.create_weight_op(name, old_shape, type_dict[ori_type])
    self.addOperand(name, op)
    return op