コード例 #1
0
    def __init__(self, var, name=None):
        super(VirtualAxis, self).__init__()
        self.num_output = 1

        if name is None:
            name = "axis_%d" % VirtualAxis.name_ct
            VirtualAxis.name_ct += 1

        self.name = name
        if isinstance(var, (int, _long)):
            self.length = var
        elif isinstance(var, schedule.IterVar):
            self.name = var.var.name
            if var.dom is None:
                self.length = -1
            else:
                self.length = get_const_int(var.dom.extent)
        elif isinstance(var, VirtualAxis):
            self.length = var.length
        else:
            raise RuntimeError("Invalid type of axis: " + str(type(var)))
コード例 #2
0
ファイル: space.py プロジェクト: bddppq/tvm
    def __init__(self, var, name=None):
        super(VirtualAxis, self).__init__()
        self.num_output = 1

        if name is None:
            name = 'axis_%d' % VirtualAxis.name_ct
            VirtualAxis.name_ct += 1

        self.name = name
        if isinstance(var, (int, _long)):
            self.length = var
        elif isinstance(var, schedule.IterVar):
            self.name = var.var.name
            if var.dom is None:
                self.length = -1
            else:
                self.length = get_const_int(var.dom.extent)
        elif isinstance(var, VirtualAxis):
            self.length = var.length
        else:
            raise RuntimeError("Invalid type of axis: " + str(type(var)))