class_docstr: Strategy Compiler.
  
  Currently, this just entails resolving device attributes,
  but this can be easily modified to do more in the future.
code: def _prune_nodes(self, strategy):
      # Prune the nodes without stateful updates
      s = strategy.copy()
      s.node_config = [
          n
          for n in strategy.node_config
          if get_op_name(n.var_name)
          in self._graph_item.var_op_name_to_grad_info
      ]
      return s
  
imports: import os
  from abc import ABC, abstractmethod
  from datetime import datetime
  from autodist.const import DEFAULT_SERIALIZATION_DIR
  from autodist.graph_item import GraphItem
  from autodist.kernel.common.utils import get_op_name
  from autodist.proto import strategy_pb2
  from autodist.resource_spec import ResourceSpec
label_desc: Use image node_id 5 for calling the StrategyCompiler obj's underlying member method code with example usage: obj._prune_nodes(strategy) and returns: s