未验证 提交 f651cefe 编写于 作者: Y Yang Yu

Merge branch 'feature/fill_constant_no_template' into feature/fill_constant_force_cpu

......@@ -272,11 +272,10 @@ struct TensorSetConstantWithPlace : public boost::static_visitor<void> {
void set_constant(const platform::DeviceContext& context,
framework::Tensor* tensor, float value) {
TensorSetConstantWithPlace func(context, tensor, value);
#ifdef PADDLE_WITH_CUDA
boost::apply_visitor(TensorSetConstantWithPlace(context, tensor, value),
tensor->place());
tensor->place().apply_visitor(func);
#else
TensorSetConstantWithPlace func(context, tensor, value);
func(platform::CPUPlace());
#endif
}
......
......@@ -12,6 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/framework/data_type.h"
#include "paddle/operators/math/math_function.h"
namespace paddle {
......
......@@ -26,4 +26,5 @@ class TestAccuracyOp(OpTest):
if __name__ == '__main__':
exit(0)
unittest.main()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册