Esempio n. 1
0
    def to_vineyard_tensor(self, selector=None, vertex_range=None, axis=0):
        """Get the context data as a vineyard tensor and return the vineyard object id.

        Returns:
            :class:`graphscope.framework.context.ResultDAGNode`:
                A result hold the object id of vineyard tensor, evaluated in eager mode.
        """
        self._check_selector(selector)
        vertex_range = utils.transform_vertex_range(vertex_range)
        op = dag_utils.to_vineyard_tensor(self, selector, vertex_range, axis)
        return ResultDAGNode(self, op)
Esempio n. 2
0
    def to_vineyard_tensor(self, selector=None, vertex_range=None, axis=0):
        """Return results as a vineyard tensor.
        Only object id is returned.

        Returns:
            str: object id of vineyard tensor
        """
        self._check_unmodified()
        selector = self._transform_selector(selector)
        vertex_range = utils.transform_vertex_range(vertex_range)

        op = dag_utils.to_vineyard_tensor(self, selector, vertex_range, axis)
        ret = op.eval()
        object_id = json.loads(ret)["object_id"]
        return object_id