code: def non_stochastic_network_to_typed(
      network: FeedForwardNetwork,
  ) -> TypedFeedForwardNetwork:
      """Converts non-stochastic FeedForwardNetwork to TypedFeedForwardNetwork.
  
      Non-stochastic network is the one that doesn't take a random key as an input
      for its `apply` method.
  
      Arguments:
        network: non-stochastic feed-forward network.
  
      Returns:
        corresponding TypedFeedForwardNetwork
      """
  
      def apply(
          params: Params,
          observation: Observation,
          *args,
          is_training: bool,
          key: Optional[PRNGKey] = None,
          **kwargs,
      ) -> NetworkOutput:
          del is_training, key
          return network.apply(params, observation, *args, **kwargs)
  
      return TypedFeedForwardNetwork(init=network.init, apply=apply)
  
file_path: acme/acme/jax/networks/base.py
imports: import dataclasses
  from typing import Callable, Optional, Tuple
  from acme import specs
  from acme import types
  from acme.jax import types
  from acme.jax import utils
  import haiku
  import jax.numpy
  from typing_extensions import Protocol
label_desc: Use image node_id 1 for calling a global function with example usage: non_stochastic_network_to_typed(network) and returns: TypedFeedForwardNetwork, network