This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| def get_candidates(git_command=''): | |
| git_command = 'git log --pretty=format:"%h" --since=2019-10-01' | |
| res = os.popen(git_command).read() | |
| candidates = res.split('\n') | |
| # for line in candidates: | |
| # print(line) | |
| return candidates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| import paddle | |
| import paddle.fluid as fluid | |
| import unittest | |
| import numpy as np | |
| def get_paddle_loss(input, label, reduction): | |
| loss = paddle.nn.loss.L1Loss(reduction=reduction) | |
| with fluid.dygraph.guard(): | |
| return loss(fluid.dygraph.to_variable(input), fluid.dygraph.to_variable(label)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include "paddle/fluid/imperative/tracer.h" | |
| namespace py = pybind11; | |
| namespace paddle { | |
| namespace pybind { | |
| std::shared_ptr<imperative::VarBase> imperative_logical_xor(const std::shared_ptr<imperative::VarBase>& X,const std::shared_ptr<imperative::VarBase>& Y, const py::args& args) | |
| { | |
| framework::AttributeMap attrs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include "paddle/fluid/imperative/tracer.h" | |
| namespace py = pybind11; | |
| namespace paddle { | |
| namespace pybind { | |
| const std::shared_ptr<imperative::VarBase>& imperative_logical_xor(const std::shared_ptr<imperative::VarBase>& X,const std::shared_ptr<imperative::VarBase>& Y, const py::args& args) | |
| { | |
| framework::AttributeMap attrs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| def compile(commit): | |
| cmake = 'cmake ../.. -DCMAKE_BUILD_TYPE=Release -DWITH_DSO=ON -DWITH_GPU=OFF -DWITH_AMD_GPU=OFF -DWITH_DISTRIBUTE=OFF -DWITH_MKL=ON -DWITH_NGRAPH=OFF -DWITH_AVX=ON -DNOAVX_CORE_FILE= -DWITH_GOLANG=OFF -DCUDA_ARCH_NAME=All -DCUDA_ARCH_BIN= -DWITH_PYTHON=ON -DCUDNN_ROOT=/usr/ -DWITH_TESTING=ON -DWITH_COVERAGE=OFF -DCMAKE_MODULE_PATH=/opt/rocm/hip/cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DWITH_CONTRIB=ON -DWITH_INFERENCE_API_TEST=ON -DWITH_HIGH_LEVEL_API_TEST=OFF -DINFERENCE_DEMO_INSTALL_DIR=/root/.cache/inference_demo -DPY_VERSION=2.7 -DCMAKE_INSTALL_PREFIX=/paddle/build -DWITH_GRPC=OFF' | |
| command = 'git reset --hard %s' % commit | |
| os.system(command) | |
| build = 'work/build_%s' % commit | |
| print(build) | |
| if not os.path.exists(build): | |
| os.system("mkdir %s" % build) | |
| command = 'cd %s && %s && make copy_paddle_pybind -j76' %(build, cmake) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # python3 | |
| # created by zhiqiu | |
| import sys | |
| import marshal | |
| def read_stats(stats_name): | |
| with open(stats_name, "rb") as f: | |
| d = marshal.load(f) | |
| return d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include "paddle/fluid/imperative/tracer.h" | |
| namespace py = pybind11; | |
| namespace paddle { | |
| namespace pybind { | |
| inline imperative::NameVarBaseMap imperative_read_from_array(const imperative::NameVarBaseMap& ins, const framework::AttributeMap& attrs, | |
| imperative::NameVarBaseMap outs, const std::map<std::string, size_t>& out_nums) | |
| { |
NewerOlder