* use nullptr
* converting integer literal to bool, use bool literal instead
* annotate this function with 'override' or (rarely) 'final'
* prefer using 'override' or (rarely) 'final' instead of 'virtual'
PiperOrigin-RevId:
196441181
class GPUDeviceTest : public ::testing::Test {
public:
- void TearDown() { ProcessState::singleton()->TestOnlyReset(); }
+ void TearDown() override { ProcessState::singleton()->TestOnlyReset(); }
protected:
static SessionOptions MakeSessionOptions(
Status Instantiate(const string& function_name,
const FunctionLibraryDefinition& lib_def, AttrSlice attrs,
const FunctionLibraryRuntime::InstantiateOptions& options,
- FunctionLibraryRuntime::LocalHandle* handle) {
+ FunctionLibraryRuntime::LocalHandle* handle) override {
mutex_lock l(mu_);
*handle = next_handle_;
next_handle_++;
void Run(const FunctionLibraryRuntime::Options& opts,
FunctionLibraryRuntime::LocalHandle handle,
gtl::ArraySlice<Tensor> args, std::vector<Tensor>* rets,
- FunctionLibraryRuntime::DoneCallback done) {}
+ FunctionLibraryRuntime::DoneCallback done) override {}
private:
mutex mu_;
const ArithmeticOptimizerContext ctx_ext)
: GraphOptimizerStage("ArithmeticOptimizer", name, ctx),
ctx_ext_(ctx_ext) {}
- virtual ~ArithmeticOptimizerStage() = default;
+ ~ArithmeticOptimizerStage() override = default;
protected:
// Simplification graph rewrite can create additional nodes that are inputs
template <typename T>
class CudnnRnnAllocatorInTemp : public ScratchAllocator {
public:
- ~CudnnRnnAllocatorInTemp() = default;
+ ~CudnnRnnAllocatorInTemp() override = default;
explicit CudnnRnnAllocatorInTemp(OpKernelContext* context)
: context_(context) {}
dim_range[i] = dim_size_prod;
}
- Tensor* output = NULL;
+ Tensor* output = nullptr;
OP_REQUIRES_OK(context,
context->allocate_output(0, input.shape(), &output));
auto input_flat = input.flat<T>().data();
return path_string;
}
- const char* home = NULL;
+ const char* home = nullptr;
std::string::size_type prefix = path_string.find_first_of('/');
if (path_string.length() == 1 || prefix == 1) {
// The value of $HOME, e.g., ~/foo