Merge branch 'feature/fill_constant_no_template' into feature/fill_constant_force_cpu

mobile_baidu
Yang Yu 7 years ago
commit f651cefe27
No known key found for this signature in database
GPG Key ID: 0AC769FE2C5F8F25

@ -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()

Loading…
Cancel
Save