Expose get_graph_config function for task_runner.
PiperOrigin-RevId: 524365682
This commit is contained in:
		
							parent
							
								
									dbeb5a8126
								
							
						
					
					
						commit
						f5197a3adc
					
				| 
						 | 
				
			
			@ -204,6 +204,11 @@ This can be useful for resetting a stateful task graph to process new data.
 | 
			
		|||
Raises:
 | 
			
		||||
  RuntimeError: The underlying medipaipe graph fails to reset and restart.
 | 
			
		||||
)doc");
 | 
			
		||||
 | 
			
		||||
  task_runner.def(
 | 
			
		||||
      "get_graph_config",
 | 
			
		||||
      [](TaskRunner* self) { return self->GetGraphConfig(); },
 | 
			
		||||
      R"doc(Returns the canonicalized CalculatorGraphConfig of the underlying graph.)doc");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
}  // namespace python
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -208,6 +208,11 @@ class BaseVisionTaskApi(object):
 | 
			
		|||
    """
 | 
			
		||||
    self._runner.close()
 | 
			
		||||
 | 
			
		||||
  def get_graph_config(self) -> calculator_pb2.CalculatorGraphConfig:
 | 
			
		||||
    """Returns the canonicalized CalculatorGraphConfig of the underlying graph.
 | 
			
		||||
    """
 | 
			
		||||
    return self._runner.get_graph_config()
 | 
			
		||||
 | 
			
		||||
  def __enter__(self):
 | 
			
		||||
    """Return `self` upon entering the runtime context."""
 | 
			
		||||
    return self
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user