mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
This reverts commit 94d7f0c1ef9a4cb4db0eb5d6b1ffc55941cbeab1. Reverted https://github.com/pytorch/pytorch/pull/158475 on behalf of https://github.com/facebook-github-bot due to Diff reverted internally ([comment](https://github.com/pytorch/pytorch/pull/158475#issuecomment-3085447409))
19 lines
674 B
PowerShell
19 lines
674 B
PowerShell
param(
|
|
[string]$protoc,
|
|
[string]$srcdir,
|
|
[string]$unprocessed,
|
|
[string]$processed,
|
|
[string]$out
|
|
)
|
|
$ErrorActionPreference = "Stop"
|
|
Get-Content $unprocessed | % {$_ -Replace "caffe2/proto/caffe2.proto", "caffe2.proto"} | Set-Content $processed
|
|
Add-Content -Path $processed -Value "option optimize_for = LITE_RUNTIME;`n" -NoNewline
|
|
$dir = (Get-Item $processed).DirectoryName
|
|
|
|
copy $srcdir/caffe2/proto/caffe2.proto $srcdir/caffe2.proto
|
|
Add-Content -Path $srcdir/caffe2.proto -Value "option optimize_for = LITE_RUNTIME;`n" -NoNewline
|
|
|
|
$processed = (Get-Item $processed).Name
|
|
$cmd = "$protoc -I${dir} --cpp_out=$out $processed"
|
|
Invoke-Expression $cmd
|