hunk.code_window:         def reduce_mean_valid(t):
               return torch.mean(t * valid_mask)
           prev_dist = dist_class(prev_logits, model)
           # Make loss functions.
           logp_ratio = torch.exp(
               curr_action_dist.logp(actions) - prev_actions_logp)
  
hunk.labels: keep replace replace keep keep keep keep keep
hunk.after_edit:             def reduce_mean_valid(t):
                   return torch.mean(t * valid_mask)
           else:
               def reduce_mean_valid(t):
                   return torch.mean(t)
  
hunk.file_path: rllib/agents/ppo/ppo_torch_policy.py
hunk.type: replace
file: name: CI
  
  env:
    DEBIAN_FRONTEND: noninteractive
  
  on: [push, pull_request]
  
  jobs:
    iwyu:
      name: ${{ matrix.name }}
      runs-on: ${{ matrix.os }}
      strategy:
        fail-fast: false
        matrix:
          name: [
            ubuntu-clang-iwyu,
          ]
          include:
            - name: ubuntu-clang-iwyu
              os: ubuntu-latest
              compiler: clang
      steps:
      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 1
      - name: Setup Bazel
        shell: bash
        env:
          BAZEL_CACHE_CREDENTIAL_B64: ${{ secrets.BAZEL_CACHE_CREDENTIAL_B64 }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: ./ci/travis/install-bazel.sh
      - name: Setup Clang Include-What-You-Use
        shell: bash
        run: |
          sudo apt-get install iwyu
      - name: Perform build
        continue-on-error: true
        shell: bash
        env:
          CC: ${{ matrix.compiler }}
        run: |
          # TODO(mehrdadn): Replace this with the same build script as below, once we factor that out
          . ./ci/travis/build-helper.sh prep_build_env
          bazel --batch build \
            --compilation_mode=fastbuild \
            --config=iwyu \
            --keep_going \
            "//:*"
    build:
      name: ${{ matrix.name }}
      runs-on: ${{ matrix.os }}
      strategy:
        fail-fast: false
        matrix:
          # Github Actions requires a single row to be added to the build matrix.
          # See https://help.github.com/en/articles/workflow-syntax-for-github-actions.
          name: [
            windows-clang-cl,
          ]
          include:
            - name: windows-clang-cl
              os: windows-latest
              compiler: clang-cl
      steps:
      - name: Checkout repository
        uses: actions/checkout@v2
      - name: Setup Bazel
        shell: bash
        env:
          BAZEL_CACHE_CREDENTIAL_B64: ${{ secrets.BAZEL_CACHE_CREDENTIAL_B64 }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: ./ci/travis/install-bazel.sh
      - name: Install C/C++ toolchains
        if: matrix.compiler == 'clang' || matrix.compiler == 'clang-cl'
        shell: bash
        env:
          CC: ${{ matrix.compiler }}
        run: ./ci/travis/install-toolchains.sh "${CC%%-*}"
      - name: Install MSYS2 (only needed if some shell commands are missing)
        if: false && runner.os == 'Windows'
        uses: numworks/setup-msys2@v1
        with:
          update: false
      - name: Perform build
        shell: bash
        run: |
          . ./ci/travis/build-helper.sh prep_build_env
          bazel --batch build \
            --keep_going \
            "//:ray_pkg"  # TODO(mehrdadn): Should be "//:*", but we get a linking error with _streaming.so
  