Skip to content

Commit

Permalink
Rename InputRef/OutputRef to Input/Output in workspace API (NVIDIA#3451)
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
  • Loading branch information
klecki authored and cyyever committed Jan 23, 2022
1 parent eb75c86 commit 03a5b7c
Show file tree
Hide file tree
Showing 198 changed files with 677 additions and 677 deletions.
4 changes: 2 additions & 2 deletions dali/benchmark/caffe2_alexnet_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ BENCHMARK_DEFINE_F(C2Alexnet, Caffe2Pipe)(benchmark::State& st) { // NOLINT
}
}

WriteCHWBatch<float16>(ws.OutputRef<GPUBackend>(0), 128, 1, "img");
WriteCHWBatch<float16>(ws.Output<GPUBackend>(0), 128, 1, "img");
int num_batches = st.iterations() + static_cast<int>(pipelined);
st.counters["FPS"] = benchmark::Counter(batch_size*num_batches,
benchmark::Counter::kIsRate);
Expand Down Expand Up @@ -258,7 +258,7 @@ BENCHMARK_DEFINE_F(C2Alexnet, HybridPipe)(benchmark::State& st) { // NOLINT
}
}

// WriteCHWBatch<float16>(ws.OutputRef<GPUBackend>(0), 128, 1, "img");
// WriteCHWBatch<float16>(ws.Output<GPUBackend>(0), 128, 1, "img");
int num_batches = st.iterations() + static_cast<int>(pipelined);
st.counters["FPS"] = benchmark::Counter(batch_size*num_batches,
benchmark::Counter::kIsRate);
Expand Down
4 changes: 2 additions & 2 deletions dali/benchmark/caffe_alexnet_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ BENCHMARK_DEFINE_F(Alexnet, CaffePipe)(benchmark::State& st) { // NOLINT
}
}

WriteCHWBatch<float16>(ws.OutputRef<GPUBackend>(0), 128, 1, "img");
WriteCHWBatch<float16>(ws.Output<GPUBackend>(0), 128, 1, "img");
int num_batches = st.iterations() + static_cast<int>(pipelined);
st.counters["FPS"] = benchmark::Counter(batch_size*num_batches,
benchmark::Counter::kIsRate);
Expand Down Expand Up @@ -259,7 +259,7 @@ BENCHMARK_DEFINE_F(Alexnet, HybridPipe)(benchmark::State& st) { // NOLINT
}
}

// WriteCHWBatch<float16>(ws.OutputRef<GPUBackend>(0), 128, 1, "img");
// WriteCHWBatch<float16>(ws.Output<GPUBackend>(0), 128, 1, "img");
int num_batches = st.iterations() + static_cast<int>(pipelined);
st.counters["FPS"] = benchmark::Counter(batch_size*num_batches,
benchmark::Counter::kIsRate);
Expand Down
2 changes: 1 addition & 1 deletion dali/benchmark/decoder_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class DecoderBench : public DALIBenchmark {
}
}

// WriteCHWBatch<float16>(ws.OutputRef<GPUBackend>(0), 128, 1, "img");
// WriteCHWBatch<float16>(ws.Output<GPUBackend>(0), 128, 1, "img");
int num_batches = st.iterations() + 1;
st.counters["FPS"] = benchmark::Counter(batch_size*num_batches,
benchmark::Counter::kIsRate);
Expand Down
2 changes: 1 addition & 1 deletion dali/benchmark/file_reader_alexnet_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ BENCHMARK_DEFINE_F(FileReaderAlexnet, CaffePipe)(benchmark::State& st) { // NOLI
}
}

WriteCHWBatch<float16>(ws.OutputRef<GPUBackend>(0), 128, 1, "img");
WriteCHWBatch<float16>(ws.Output<GPUBackend>(0), 128, 1, "img");
int num_batches = st.iterations() + static_cast<int>(pipelined);
st.counters["FPS"] = benchmark::Counter(batch_size*num_batches,
benchmark::Counter::kIsRate);
Expand Down
6 changes: 3 additions & 3 deletions dali/benchmark/resnet50_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ BENCHMARK_DEFINE_F(RN50, C2Pipe)(benchmark::State& st) { // NOLINT
}
}

// WriteCHWBatch<float16>(ws.OutputRef<GPUBackend>(0), 128, 1, "img");
// WriteCHWBatch<float16>(ws.Output<GPUBackend>(0), 128, 1, "img");
int num_batches = st.iterations() + static_cast<int>(pipelined);
st.counters["FPS"] = benchmark::Counter(batch_size*num_batches,
benchmark::Counter::kIsRate);
Expand Down Expand Up @@ -266,7 +266,7 @@ BENCHMARK_DEFINE_F(RN50, HybridPipe)(benchmark::State& st) { // NOLINT
}
}

// WriteCHWBatch<float16>(ws.OutputRef<GPUBackend>(0), 128, 1, "img");
// WriteCHWBatch<float16>(ws.Output<GPUBackend>(0), 128, 1, "img");
int num_batches = st.iterations() + static_cast<int>(pipelined);
st.counters["FPS"] = benchmark::Counter(batch_size*num_batches,
benchmark::Counter::kIsRate);
Expand Down Expand Up @@ -379,7 +379,7 @@ BENCHMARK_DEFINE_F(RN50, nvJPEGPipe)(benchmark::State& st) { // NOLINT
}
}

// WriteCHWBatch<float16>(ws.OutputRef<GPUBackend>(0), 128, 1, "img");
// WriteCHWBatch<float16>(ws.Output<GPUBackend>(0), 128, 1, "img");
int num_batches = st.iterations() + static_cast<int>(pipelined);
st.counters["FPS"] = benchmark::Counter(batch_size*num_batches,
benchmark::Counter::kIsRate);
Expand Down
2 changes: 1 addition & 1 deletion dali/benchmark/resnet50_nvjpeg_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ BENCHMARK_DEFINE_F(RealRN50, nvjpegPipe)(benchmark::State& st) { // NOLINT
}

#if DALI_DEBUG
WriteHWCBatch(ws.OutputRef<GPUBackend>(0), "img");
WriteHWCBatch(ws.Output<GPUBackend>(0), "img");
#endif
int num_batches = st.iterations() + static_cast<int>(pipelined);
st.counters["FPS"] = benchmark::Counter(batch_size*num_batches,
Expand Down
24 changes: 12 additions & 12 deletions dali/c_api/c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -318,17 +318,17 @@ void daliOutputRelease(daliPipelineHandle *pipe_handle) {
int64_t daliOutputHasUniformShape(daliPipelineHandle* pipe_handle, int i) {
dali::DeviceWorkspace* ws = reinterpret_cast<dali::DeviceWorkspace*>(pipe_handle->ws);
if (ws->OutputIsType<dali::CPUBackend>(i)) {
return is_uniform(ws->OutputRef<dali::CPUBackend>(i).shape());
return is_uniform(ws->Output<dali::CPUBackend>(i).shape());
} else {
return is_uniform(ws->OutputRef<dali::GPUBackend>(i).shape());
return is_uniform(ws->Output<dali::GPUBackend>(i).shape());
}
}

template<typename T>
static int64_t *daliShapeAtHelper(dali::DeviceWorkspace *ws, int n, int k) {
int64_t *c_shape = nullptr;
std::vector<dali::Index> shape;
const auto &out_tensor_list = ws->OutputRef<T>(n);
const auto &out_tensor_list = ws->Output<T>(n);
if (k >= 0) {
auto shape_span = out_tensor_list.tensor_shape_span(k);
shape = std::vector<dali::Index>(shape_span.begin(), shape_span.end());
Expand Down Expand Up @@ -366,7 +366,7 @@ int64_t* daliShapeAt(daliPipelineHandle* pipe_handle, int n) {

template <typename T>
static dali_data_type_t daliTypeAtHelper(dali::DeviceWorkspace* ws, int n) {
const auto &out_tensor_list = ws->OutputRef<T>(n);
const auto &out_tensor_list = ws->Output<T>(n);
auto type_id = out_tensor_list.type();
return static_cast<dali_data_type_t>(static_cast<int>(type_id));
}
Expand All @@ -383,7 +383,7 @@ dali_data_type_t daliTypeAt(daliPipelineHandle* pipe_handle, int n) {

template <typename T>
static size_t daliNumTensorsHelper(dali::DeviceWorkspace* ws, int n) {
return ws->OutputRef<T>(n).num_samples();
return ws->Output<T>(n).num_samples();
}

size_t daliNumTensors(daliPipelineHandle* pipe_handle, int n) {
Expand All @@ -397,7 +397,7 @@ size_t daliNumTensors(daliPipelineHandle* pipe_handle, int n) {

template <typename T>
static size_t daliNumElementsHelper(dali::DeviceWorkspace* ws, int n) {
return ws->OutputRef<T>(n)._num_elements();
return ws->Output<T>(n)._num_elements();
}

size_t daliNumElements(daliPipelineHandle* pipe_handle, int n) {
Expand All @@ -411,7 +411,7 @@ size_t daliNumElements(daliPipelineHandle* pipe_handle, int n) {

template <typename T>
static size_t daliTensorSizeHelper(dali::DeviceWorkspace* ws, int n) {
return ws->OutputRef<T>(n).nbytes();
return ws->Output<T>(n).nbytes();
}

size_t daliTensorSize(daliPipelineHandle* pipe_handle, int n) {
Expand All @@ -425,7 +425,7 @@ size_t daliTensorSize(daliPipelineHandle* pipe_handle, int n) {

template <typename T>
static size_t daliMaxDimTensorsHelper(dali::DeviceWorkspace* ws, int n) {
const auto &out_tensor_list = ws->OutputRef<T>(n);
const auto &out_tensor_list = ws->Output<T>(n);
size_t tensors_num = out_tensor_list.num_samples();
int max_num_dim = 0;
for (size_t i = 0; i < tensors_num; ++i) {
Expand Down Expand Up @@ -481,10 +481,10 @@ void daliOutputCopy(daliPipelineHandle *pipe_handle, void *dst, int output_idx,

auto &type_info = dali::TypeTable::GetTypeInfo(dali::DALIDataType::DALI_UINT8);
if (ws->OutputIsType<dali::CPUBackend>(output_idx)) {
CopyToExternal(dst, dst_mem_kind, ws->OutputRef<dali::CPUBackend>(output_idx),
CopyToExternal(dst, dst_mem_kind, ws->Output<dali::CPUBackend>(output_idx),
stream, use_copy_kernel);
} else {
CopyToExternal(dst, dst_mem_kind, ws->OutputRef<dali::GPUBackend>(output_idx),
CopyToExternal(dst, dst_mem_kind, ws->Output<dali::GPUBackend>(output_idx),
stream, use_copy_kernel);
}
if (sync) {
Expand All @@ -506,10 +506,10 @@ void daliOutputCopySamples(daliPipelineHandle *pipe_handle, void **dsts, int out

auto &type_info = dali::TypeTable::GetTypeInfo(dali::DALIDataType::DALI_UINT8);
if (ws->OutputIsType<dali::CPUBackend>(output_idx)) {
CopyToExternal(dsts, dst_mem_kind, ws->OutputRef<dali::CPUBackend>(output_idx),
CopyToExternal(dsts, dst_mem_kind, ws->Output<dali::CPUBackend>(output_idx),
stream, use_copy_kernel);
} else {
CopyToExternal(dsts, dst_mem_kind, ws->OutputRef<dali::GPUBackend>(output_idx),
CopyToExternal(dsts, dst_mem_kind, ws->Output<dali::GPUBackend>(output_idx),
stream, use_copy_kernel);
}
if (sync) {
Expand Down
4 changes: 2 additions & 2 deletions dali/c_api/c_api_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void ComparePipelinesOutputs(daliPipelineHandle &handle, Pipeline &baseline,
EXPECT_EQ(daliNumTensors(&handle, output), batch_size);
for (int elem = 0; elem < batch_size; elem++) {
auto *shape = daliShapeAtSample(&handle, output, elem);
auto ref_shape = ws.OutputRef<Backend>(output).shape()[elem];
auto ref_shape = ws.Output<Backend>(output).shape()[elem];
int D = ref_shape.size();
for (int d = 0; d < D; d++)
EXPECT_EQ(shape[d], ref_shape[d]);
Expand All @@ -162,7 +162,7 @@ void ComparePipelinesOutputs(daliPipelineHandle &handle, Pipeline &baseline,

TensorList<CPUBackend> pipeline_output_cpu, c_api_output_cpu;
// Unnecessary copy in case of CPUBackend, makes the code generic across Backends
pipeline_output_cpu.Copy(ws.OutputRef<Backend>(0), cuda_stream);
pipeline_output_cpu.Copy(ws.Output<Backend>(0), cuda_stream);

auto num_elems = pipeline_output_cpu.shape().num_elements();
auto backend_buf = AllocBuffer<Backend>(num_elems * sizeof(uint8_t), false);
Expand Down
6 changes: 3 additions & 3 deletions dali/operators/audio/mel_scale/mel_filter_bank.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ template <>
bool MelFilterBank<CPUBackend>::SetupImpl(std::vector<OutputDesc> &output_desc,
const workspace_t<CPUBackend> &ws) {
output_desc.resize(kNumOutputs);
const auto &input = ws.InputRef<CPUBackend>(0);
const auto &input = ws.Input<CPUBackend>(0);
auto in_shape = input.shape();
int nsamples = input.num_samples();
auto nthreads = ws.GetThreadPool().NumThreads();
Expand All @@ -95,8 +95,8 @@ bool MelFilterBank<CPUBackend>::SetupImpl(std::vector<OutputDesc> &output_desc,

template <>
void MelFilterBank<CPUBackend>::RunImpl(workspace_t<CPUBackend> &ws) {
const auto &input = ws.InputRef<CPUBackend>(0);
auto &output = ws.OutputRef<CPUBackend>(0);
const auto &input = ws.Input<CPUBackend>(0);
auto &output = ws.Output<CPUBackend>(0);
auto in_shape = input.shape();
auto& thread_pool = ws.GetThreadPool();

Expand Down
6 changes: 3 additions & 3 deletions dali/operators/audio/mel_scale/mel_filter_bank_gpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ template <>
bool MelFilterBank<GPUBackend>::SetupImpl(std::vector<OutputDesc> &output_desc,
const workspace_t<GPUBackend> &ws) {
output_desc.resize(kNumOutputs);
const auto &input = ws.InputRef<GPUBackend>(0);
const auto &input = ws.Input<GPUBackend>(0);
const auto &in_shape = input.shape();
auto layout = input.GetLayout();
auto ndim = in_shape.sample_dim();
Expand All @@ -45,8 +45,8 @@ bool MelFilterBank<GPUBackend>::SetupImpl(std::vector<OutputDesc> &output_desc,

template <>
void MelFilterBank<GPUBackend>::RunImpl(workspace_t<GPUBackend> &ws) {
const auto &input = ws.InputRef<GPUBackend>(0);
auto &output = ws.OutputRef<GPUBackend>(0);
const auto &input = ws.Input<GPUBackend>(0);
auto &output = ws.Output<GPUBackend>(0);
const auto &in_shape = input.shape();
ctx_.gpu.stream = ws.stream();
TYPE_SWITCH(input.type(), type2id, T, MEL_FBANK_SUPPORTED_TYPES, (
Expand Down
8 changes: 4 additions & 4 deletions dali/operators/audio/mfcc/mfcc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ bool MFCC<CPUBackend>::SetupImpl(std::vector<OutputDesc> &output_desc,
const workspace_t<CPUBackend> &ws) {
GetArguments(ws);
output_desc.resize(kNumOutputs);
const auto &input = ws.InputRef<CPUBackend>(0);
auto &output = ws.OutputRef<CPUBackend>(0);
const auto &input = ws.Input<CPUBackend>(0);
auto &output = ws.Output<CPUBackend>(0);
kernels::KernelContext ctx;
auto in_shape = input.shape();
int nsamples = input.num_samples();
Expand Down Expand Up @@ -153,8 +153,8 @@ bool MFCC<CPUBackend>::SetupImpl(std::vector<OutputDesc> &output_desc,

template <>
void MFCC<CPUBackend>::RunImpl(workspace_t<CPUBackend> &ws) {
const auto &input = ws.InputRef<CPUBackend>(0);
auto &output = ws.OutputRef<CPUBackend>(0);
const auto &input = ws.Input<CPUBackend>(0);
auto &output = ws.Output<CPUBackend>(0);
auto in_shape = input.shape();
auto& thread_pool = ws.GetThreadPool();

Expand Down
6 changes: 3 additions & 3 deletions dali/operators/audio/mfcc/mfcc.cu
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ bool MFCC<GPUBackend>::SetupImpl(std::vector<OutputDesc> &output_desc,
const workspace_t<GPUBackend> &ws) {
GetArguments(ws);
ctx_.gpu.stream = ws.stream();
auto &input = ws.InputRef<GPUBackend>(0);
auto &input = ws.Input<GPUBackend>(0);

auto in_shape = input.shape();
int ndim = in_shape.sample_dim();
Expand All @@ -87,11 +87,11 @@ bool MFCC<GPUBackend>::SetupImpl(std::vector<OutputDesc> &output_desc,

template<>
void MFCC<GPUBackend>::RunImpl(workspace_t<GPUBackend> &ws) {
auto &input = ws.InputRef<GPUBackend>(0);
auto &input = ws.Input<GPUBackend>(0);
TYPE_SWITCH(input.type(), type2id, T, MFCC_SUPPORTED_TYPES, (
using Kernel = kernels::signal::dct::Dct1DGpu<T>;
auto in_view = view<const T>(input);
auto out_view = view<T>(ws.OutputRef<GPUBackend>(0));
auto out_view = view<T>(ws.Output<GPUBackend>(0));
auto lifter_view = make_tensor_gpu<1>(lifter_coeffs_.data(),
{static_cast<int64_t>(lifter_coeffs_.size())});
kmgr_.Run<Kernel>(0, 0, ctx_, out_view, in_view, lifter_view);
Expand Down
2 changes: 1 addition & 1 deletion dali/operators/audio/mfcc/mfcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class MFCC : public Operator<Backend> {
using Operator<Backend>::RunImpl;

void GetArguments(const workspace_t<Backend> &ws) {
auto nsamples = ws.template InputRef<Backend>(0).shape().size();
auto nsamples = ws.template Input<Backend>(0).shape().size();
DctArgs arg;
arg.ndct = spec_.template GetArgument<int>("n_mfcc");
DALI_ENFORCE(arg.ndct > 0, "number of MFCCs should be > 0");
Expand Down
2 changes: 1 addition & 1 deletion dali/operators/audio/nonsilence_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ bool NonsilenceOperatorCpu::SetupImpl(std::vector<OutputDesc> &output_desc,


void NonsilenceOperatorCpu::RunImpl(workspace_t<CPUBackend> &ws) {
const auto &input = ws.template InputRef<CPUBackend>(0);
const auto &input = ws.template Input<CPUBackend>(0);
TYPE_SWITCH(input.type(), type2id, InputType, NONSILENCE_TYPES, (
RunImplTyped<InputType>(ws);
), DALI_FAIL(make_string("Unsupported input type: ", input.type()))) // NOLINT
Expand Down
8 changes: 4 additions & 4 deletions dali/operators/audio/nonsilence_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class NonsilenceOperator : public Operator<Backend> {
reference_max_ = true;
}
window_length_ = spec.GetArgument<int>("window_length", &ws);
auto input_type = ws.template InputRef<Backend>(0).type();
auto input_type = ws.template Input<Backend>(0).type();
// If input type is not floating point, there's no need for reset interval
reset_interval_ = IsFloatingPoint(input_type) ? spec.GetArgument<int>("reset_interval", &ws)
: -1;
Expand Down Expand Up @@ -207,9 +207,9 @@ class NonsilenceOperatorCpu : public NonsilenceOperator<CPUBackend> {
private:
template<typename InputType>
void RunImplTyped(workspace_t<CPUBackend> &ws) {
const auto &input = ws.template InputRef<CPUBackend>(0);
auto &output_begin = ws.OutputRef<CPUBackend>(0);
auto &output_length = ws.OutputRef<CPUBackend>(1);
const auto &input = ws.template Input<CPUBackend>(0);
auto &output_begin = ws.Output<CPUBackend>(0);
auto &output_length = ws.Output<CPUBackend>(1);
auto curr_batch_size = ws.GetInputBatchSize(0);
auto &tp = ws.GetThreadPool();
auto in_shape = input.shape();
Expand Down
6 changes: 3 additions & 3 deletions dali/operators/audio/preemphasis_filter_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class PreemphasisFilterCPU : public PreemphasisFilter<CPUBackend> {

template <typename OutputType, typename InputType>
void PreemphasisFilterCPU::RunImplTyped(workspace_t<CPUBackend> &ws) {
const auto &input = ws.template InputRef<CPUBackend>(0);
auto &output = ws.OutputRef<CPUBackend>(0);
const auto &input = ws.template Input<CPUBackend>(0);
auto &output = ws.Output<CPUBackend>(0);
auto &tp = ws.GetThreadPool();
auto shape = input.shape();
auto nsamples = shape.num_samples();
Expand Down Expand Up @@ -92,7 +92,7 @@ void PreemphasisFilterCPU::RunImplTyped(workspace_t<CPUBackend> &ws) {
}

void PreemphasisFilterCPU::RunImpl(workspace_t<CPUBackend> &ws) {
const auto &input = ws.template InputRef<CPUBackend>(0);
const auto &input = ws.template Input<CPUBackend>(0);
TYPE_SWITCH(input.type(), type2id, InputType, PREEMPH_TYPES, (
TYPE_SWITCH(output_type_, type2id, OutputType, PREEMPH_TYPES, (
RunImplTyped<OutputType, InputType>(ws);
Expand Down
6 changes: 3 additions & 3 deletions dali/operators/audio/preemphasis_filter_op.cu
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class PreemphasisFilterGPU : public PreemphasisFilter<GPUBackend> {
template <typename OutputType, typename InputType>
void PreemphasisFilterGPU::RunImplTyped(workspace_t<GPUBackend> &ws) {
using SampleDesc = detail::SampleDescriptor<OutputType, InputType>;
const auto &input = ws.InputRef<GPUBackend>(0);
auto &output = ws.OutputRef<GPUBackend>(0);
const auto &input = ws.Input<GPUBackend>(0);
auto &output = ws.Output<GPUBackend>(0);
auto curr_batch_size = ws.GetInputBatchSize(0);

std::vector<SampleDesc> samples_cpu(curr_batch_size);
Expand All @@ -104,7 +104,7 @@ void PreemphasisFilterGPU::RunImplTyped(workspace_t<GPUBackend> &ws) {
}

void PreemphasisFilterGPU::RunImpl(workspace_t<GPUBackend> &ws) {
const auto &input = ws.template InputRef<GPUBackend>(0);
const auto &input = ws.template Input<GPUBackend>(0);
TYPE_SWITCH(input.type(), type2id, InputType, PREEMPH_TYPES, (
TYPE_SWITCH(output_type_, type2id, OutputType, PREEMPH_TYPES, (
RunImplTyped<OutputType, InputType>(ws);
Expand Down
2 changes: 1 addition & 1 deletion dali/operators/audio/preemphasis_filter_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class PreemphasisFilter : public Operator<Backend> {

bool SetupImpl(std::vector<::dali::OutputDesc> &output_desc,
const workspace_t<Backend> &ws) override {
const auto &input = ws.template InputRef<Backend>(0);
const auto &input = ws.template Input<Backend>(0);
AcquireArguments(ws);
output_desc.resize(detail::kNumOutputs);
auto shape = input.shape();
Expand Down
6 changes: 3 additions & 3 deletions dali/operators/bbox/bb_flip.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
// Copyright (c) 2017-2021, NVIDIA CORPORATION & AFFILIATES. 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.
Expand Down Expand Up @@ -40,8 +40,8 @@ system, that is 0.0-1.0)code")
0, true);

void BbFlipCPU::RunImpl(workspace_t<CPUBackend> &ws) {
const auto &input = ws.InputRef<CPUBackend>(0);
auto &output = ws.OutputRef<CPUBackend>(0);
const auto &input = ws.Input<CPUBackend>(0);
auto &output = ws.Output<CPUBackend>(0);
auto in_view = view<const float>(input);
auto out_view = view<float>(output);
auto nsamples = in_view.shape.size();
Expand Down
Loading

0 comments on commit 03a5b7c

Please sign in to comment.