mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/19218 Sync some contents between fbcode/caffe2 and xplat/caffe2 to move closer towards a world where they are identical. Reviewed By: dzhulgakov Differential Revision: D14919916 fbshipit-source-id: 29c6b6d89ac556d58ae3cd02619aca88c79591c1
18 lines
633 B
PowerShell
18 lines
633 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
|
|
|
|
$cmd = "$protoc -I${dir} --cpp_out=$out $processed"
|
|
Invoke-Expression $cmd
|