Skip to content

Commit ed5c9ac

Browse files
jblespiaucopybara-github
authored andcommitted
Replace tensorflow::Status::OK() with tensorflow::{Status, OkStatus}().
PiperOrigin-RevId: 478980615
1 parent 5b172fa commit ed5c9ac

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

tensorflow_graphics/rendering/opengl/gl_render_targets.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class RenderTargets {
4949
// * render_targets: a valid and usable instance of this class.
5050
//
5151
// Returns:
52-
// A tensorflow::Status object storing tensorflow::Status::OK() on success,
52+
// A tensorflow::Status object storing tensorflow::Status() on success,
5353
// and an object of type tensorflow::errors otherwise.
5454
template <typename T>
5555
static tensorflow::Status Create(
@@ -73,7 +73,7 @@ class RenderTargets {
7373
// size of this buffer must be equal to 4 * width * height.
7474
//
7575
// Returns:
76-
// A tensorflow::Status object storing tensorflow::Status::OK() on success,
76+
// A tensorflow::Status object storing tensorflow::Status() on success,
7777
// and an object of type tensorflow::errors otherwise.
7878
template <typename T>
7979
tensorflow::Status CopyPixelsInto(absl::Span<T> buffer) const;
@@ -152,7 +152,7 @@ tensorflow::Status RenderTargets::CopyPixelsIntoValidPixelType(
152152

153153
TFG_RETURN_IF_GL_ERROR(
154154
glReadPixels(0, 0, width_, height_, GL_RGBA, pixel_type, buffer.data()));
155-
return tensorflow::Status::OK();
155+
return tensorflow::Status();
156156
}
157157

158158
} // namespace gl_utils

tensorflow_graphics/rendering/opengl/gl_shader_storage_buffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ tensorflow::Status ShaderStorageBuffer::Upload(absl::Span<T> data) const {
5959
data.size() * sizeof(T), data.data(),
6060
GL_DYNAMIC_COPY));
6161
// bind_cleanup is not released, leading the buffer to be unbound.
62-
return tensorflow::Status::OK();
62+
return tensorflow::Status();
6363
}
6464

6565
} // namespace gl_utils

tensorflow_graphics/rendering/opengl/rasterizer.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Rasterizer {
4545
// storing a ready to use rasterizer.
4646
//
4747
// Returns:
48-
// A tensorflow::Status object storing tensorflow::Status::OK() on success,
48+
// A tensorflow::Status object storing tensorflow::Status() on success,
4949
// and an object of type tensorflow::errors otherwise.
5050
template <typename T>
5151
static tensorflow::Status Create(const int width, const int height,
@@ -72,7 +72,7 @@ class Rasterizer {
7272
// storing a ready to use rasterizer.
7373
//
7474
// Returns:
75-
// A tensorflow::Status object storing tensorflow::Status::OK() on success,
75+
// A tensorflow::Status object storing tensorflow::Status() on success,
7676
// and an object of type tensorflow::errors otherwise.
7777
template <typename T>
7878
static tensorflow::Status Create(const int width, const int height,
@@ -94,7 +94,7 @@ class Rasterizer {
9494
// Create.
9595
//
9696
// Returns:
97-
// A tensorflow::Status object storing tensorflow::Status::OK() on success,
97+
// A tensorflow::Status object storing tensorflow::Status() on success,
9898
// and an object of type tensorflow::errors otherwise.
9999
virtual tensorflow::Status Render(int num_points, absl::Span<float> result);
100100
virtual tensorflow::Status Render(int num_points,
@@ -107,7 +107,7 @@ class Rasterizer {
107107
// * data: data to upload to the shader storage buffer.
108108
//
109109
// Returns:
110-
// A tensorflow::Status object storing tensorflow::Status::OK() on success,
110+
// A tensorflow::Status object storing tensorflow::Status() on success,
111111
// and an object of type tensorflow::errors otherwise.
112112
template <typename T>
113113
tensorflow::Status SetShaderStorageBuffer(const std::string& name,
@@ -126,7 +126,7 @@ class Rasterizer {
126126
// * matrix: a buffer storing the matrix
127127
//
128128
// Returns:
129-
// A tensorflow::Status object storing tensorflow::Status::OK() on success,
129+
// A tensorflow::Status object storing tensorflow::Status() on success,
130130
// and an object of type tensorflow::errors otherwise.
131131
virtual tensorflow::Status SetUniformMatrix(const std::string& name,
132132
int num_columns, int num_rows,
@@ -192,7 +192,7 @@ tensorflow::Status Rasterizer::Create(const int width, const int height,
192192
*rasterizer = std::unique_ptr<Rasterizer>(new Rasterizer(
193193
std::move(program), std::move(render_targets), clear_red, clear_green,
194194
clear_blue, clear_alpha, clear_depth, enable_cull_face));
195-
return tensorflow::Status::OK();
195+
return tensorflow::Status();
196196
}
197197

198198
template <typename T>
@@ -210,7 +210,7 @@ tensorflow::Status Rasterizer::RenderImpl(int num_points,
210210
GLint slot;
211211
if (program_->GetResourceProperty(name, GL_SHADER_STORAGE_BLOCK, 1,
212212
&kProperty, 1,
213-
&slot) != tensorflow::Status::OK())
213+
&slot) != tensorflow::Status())
214214
// Buffer not found in program, so do nothing.
215215
continue;
216216
TF_RETURN_IF_ERROR(buffer.second->BindBufferBase(slot));
@@ -237,7 +237,7 @@ tensorflow::Status Rasterizer::RenderImpl(int num_points,
237237
TF_RETURN_IF_ERROR(render_targets_->CopyPixelsInto(result));
238238

239239
// The program and framebuffer and released here.
240-
return tensorflow::Status::OK();
240+
return tensorflow::Status();
241241
}
242242

243243
template <typename T>
@@ -254,7 +254,7 @@ tensorflow::Status Rasterizer::SetShaderStorageBuffer(
254254
// Upload the data to the shader storage buffer.
255255
TF_RETURN_IF_ERROR(shader_storage_buffers_.at(name)->Upload(data));
256256

257-
return tensorflow::Status::OK();
257+
return tensorflow::Status();
258258
}
259259

260260
#endif // THIRD_PARTY_PY_TENSORFLOW_GRAPHICS_RENDERING_OPENGL_TESTS_RASTERIZER_H_

tensorflow_graphics/rendering/opengl/rasterizer_with_context.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ tensorflow::Status RasterizerWithContext::SetShaderStorageBuffer(
125125
MakeCleanup([this]() { return this->egl_context_->Release(); });
126126
TF_RETURN_IF_ERROR(Rasterizer::SetShaderStorageBuffer(name, data));
127127
// context_cleanup calls EGLOffscreenContext::Release here.
128-
return tensorflow::Status::OK();
128+
return tensorflow::Status();
129129
}
130130

131131
template <typename T>
@@ -138,7 +138,7 @@ tensorflow::Status RasterizerWithContext::SetUniformMatrix(
138138
TF_RETURN_IF_ERROR(Rasterizer::SetUniformMatrix(name, num_columns, num_rows,
139139
transpose, matrix));
140140
// context_cleanup calls EGLOffscreenContext::Release here.
141-
return tensorflow::Status::OK();
141+
return tensorflow::Status();
142142
}
143143

144144
// template <typename T>
@@ -149,7 +149,7 @@ tensorflow::Status RasterizerWithContext::SetUniformMatrix(
149149
// MakeCleanup([this]() { return this->egl_context_->Release(); });
150150
// TF_RETURN_IF_ERROR(Rasterizer::Render(num_points, result));
151151
// // context_cleanup calls EGLOffscreenContext::Release here.
152-
// return tensorflow::Status::OK();
152+
// return tensorflow::Status();
153153
// }
154154

155155
#endif // THIRD_PARTY_PY_TENSORFLOW_GRAPHICS_RENDERING_OPENGL_RASTERIZER_WITH_CONTEXT_H_

tensorflow_graphics/rendering/opengl/thread_safe_resource_pool.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ThreadSafeResourcePool
4444
// the acquired resource.
4545
//
4646
// Returns:
47-
// A tensorflow::Status object storing tensorflow::Status::OK() on success,
47+
// A tensorflow::Status object storing tensorflow::Status() on success,
4848
// and an object of type tensorflow::errors otherwise.
4949
tensorflow::Status AcquireResource(std::unique_ptr<T>* resource);
5050

@@ -55,7 +55,7 @@ class ThreadSafeResourcePool
5555
// * resource: the resource to return to the pool.
5656
//
5757
// Returns:
58-
// A tensorflow::Status object storing tensorflow::Status::OK() on success,
58+
// A tensorflow::Status object storing tensorflow::Status() on success,
5959
// and an object of type tensorflow::errors otherwise.
6060
tensorflow::Status ReturnResource(std::unique_ptr<T>& resource);
6161

@@ -92,7 +92,7 @@ tensorflow::Status ThreadSafeResourcePool<T>::AcquireResource(
9292
*resource = std::move(resource_pool_.back());
9393
resource_pool_.pop_back();
9494
}
95-
return tensorflow::Status::OK();
95+
return tensorflow::Status();
9696
}
9797

9898
template <typename T>
@@ -108,7 +108,7 @@ tensorflow::Status ThreadSafeResourcePool<T>::ReturnResource(
108108
resource_pool_.push_back(std::move(resource));
109109
else
110110
resource.reset();
111-
return tensorflow::Status::OK();
111+
return tensorflow::Status();
112112
}
113113

114114
#endif // THIRD_PARTY_PY_TENSORFLOW_GRAPHICS_RENDERING_OPENGL_THREAD_SAFE_RESOURCE_POOL_H_

0 commit comments

Comments
 (0)