Exemplo n.º 1
0
    def output_dtype(self):
        self._op_db = db.refresh(self._op_db)
        if self._op_db.outputs is None or self._op_db.outputs == "null":
            return None

        data_id = json.loads(self._op_db.outputs)[0]
        data = Data(id=data_id)
        return data.dtype
Exemplo n.º 2
0
    def to_scalar(self):
        self._op_db = db.refresh(self._op_db)
        if self._op_db.outputs is None or self._op_db.outputs == "null":
            return None

        data_id = json.loads(self._op_db.outputs)[0]
        data = Data(id=data_id)
        return Scalar(data.value)
Exemplo n.º 3
0
 def value(self):
     self._data_db = db.refresh(self._data_db)
     if self.dtype == "ndarray":
         file_path = self._data_db.file_path
         value = np.load(file_path, allow_pickle=True)
         return value
     elif self.dtype in ["int", "float"]:
         if self.dtype == "int":
             return int(self._data_db.value)
         elif self.dtype == "float":
             return float(self._data_db.value)
Exemplo n.º 4
0
 def status(self):
     self._graph_db = db.refresh(self._graph_db)
     return self._graph_db.status
Exemplo n.º 5
0
 def dtype(self):
     self._data_db = db.refresh(self._data_db)
     return self._data_db.type
Exemplo n.º 6
0
 def status(self):
     self._op_db = db.refresh(self._op_db)
     return self._op_db.status