class_docstr: The network architecture proposed in `OPD <https://seqml.github.io/opd/opd_aaai21_supplement.pdf>`_.
  
  At every time step the input of policy network is divided into two parts,
  the public variables and the private variables. which are handled by ``raw_rnn``
  and ``pri_rnn`` in this network, respectively.
  
  One minor difference is that, in this implementation, we don't assume the direction to be fixed.
  Thus, another ``dire_fc`` is added to produce an extra direction-related feature.
class_docstr_tok: ["The","network","architecture","proposed","in","`","OPD","<","https",":","\/\/seqml.github.io\/opd\/opd_aaai21_supplement.pdf",">","`","_",".","At","every","time","step","the","input","of","policy","network","is","divided","into","two","parts",",","the","public","variables","and","the","private","variables",".","which","are","handled","by","``","raw_rnn","``","and","``","pri_rnn","``","in","this","network",",","respectively",".","One","minor","difference","is","that",",","in","this","implementation",",","we","do","n't","assume","the","direction","to","be","fixed",".","Thus",",","another","``","dire_fc","``","is","added","to","produce","an","extra","direction-related","feature","."]
code: def _source_features(
      self, obs: FullHistoryObs, device: torch.device
  ) -> Tuple[List[torch.Tensor], torch.Tensor]:
      bs, _, data_dim = obs["data_processed"].size()
      data = torch.cat(
          (
              torch.zeros(bs, 1, data_dim, device=device),
              obs["data_processed"],
          ),
          1,
      )
      cur_step = obs["cur_step"].long()
      cur_tick = obs["cur_tick"].long()
      bs_indices = torch.arange(bs, device=device)
  
      position = obs["position_history"] / obs["target"].unsqueeze(
          -1
      )  # [bs, num_step]
      steps = (
          torch.arange(position.size(-1), device=device)
          .unsqueeze(0)
          .repeat(bs, 1)
          .float()
          / obs["num_step"].unsqueeze(-1).float()
      )  # [bs, num_step]
      priv = torch.stack((position.float(), steps), -1)
  
      data_in = self.raw_fc(data)
      data_out, _ = self.raw_rnn(data_in)
      # as it is padded with zero in front, this should be last minute
      data_out_slice = data_out[bs_indices, cur_tick]
  
      priv_in = self.pri_fc(priv)
      priv_out = self.pri_rnn(priv_in)[0]
      priv_out = priv_out[bs_indices, cur_step]
  
      sources = [data_out_slice, priv_out]
  
      dir_out = self.dire_fc(
          torch.stack(
              (obs["acquiring"], 1 - obs["acquiring"]), -1
          ).float()
      )
      sources.append(dir_out)
  
      return sources, data_out
  
file_path: qlib/qlib/rl/order_execution/network.py
imports: from __future__ import annotations
  from typing import List, Tuple, cast
  import torch
  import torch.nn
  from tianshou.data import Batch
  from qlib.typehint import Literal
  from .interpreter import FullHistoryObs
label_desc: Use image node_id 3 for calling the Recurrent obj's underlying member method code with example usage: obj._source_features(obs, device) and returns: sources,  data_out