8aaabd6dfcd2f4ae5618ef08657bbba82e8bd69f,mesh_renderer/rasterize_triangles.py,,rasterize_clip_space,#Any#Any#Any#Any#Any#Any#,69
Before Change
raise ValueError("Image height must be > 0.")
if len(clip_space_vertices.shape) != 3:
raise ValueError("The vertex buffer must be 3D.")
batch_size = clip_space_vertices.shape[0].value
vertex_count = clip_space_vertices.shape[1].value
per_image_barycentric_coordinates = []
After Change
vertex_count = clip_space_vertices.shape[1].value
batch_size = tf.shape(clip_space_vertices)[0]
per_image_barycentric_coordinates = tf.TensorArray(dtype=tf.float32, size=batch_size)
per_image_vertex_ids = tf.TensorArray(dtype=tf.int32, size=batch_size)
def condition(b, *args):
return b < batch_size
def iteration(b, per_image_barycentric_coordinates, per_image_vertex_ids):
barycentric_coords, triangle_ids, _ = (
rasterize_triangles_module.rasterize_triangles(
clip_space_vertices[b, :, :], triangles, image_width,
image_height))
per_image_barycentric_coordinates = per_image_barycentric_coordinates.write(b, tf.reshape(barycentric_coords, [-1, 3]))
vertex_ids = tf.gather(triangles, tf.reshape(triangle_ids, [-1]))
reindexed_ids = tf.add(vertex_ids, b * clip_space_vertices.shape[1].value)
per_image_vertex_ids = per_image_vertex_ids.write(b, reindexed_ids)
return b+1, per_image_barycentric_coordinates, per_image_vertex_ids
b = tf.placeholder_with_default(0, shape=[])
_, per_image_barycentric_coordinates, per_image_vertex_ids = tf.while_loop(condition, iteration, [b, per_image_barycentric_coordinates, per_image_vertex_ids])
barycentric_coordinates = tf.reshape(per_image_barycentric_coordinates.stack(), [-1, 3])
vertex_ids = tf.reshape(per_image_vertex_ids.stack(), [-1, 3])
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: google/tf_mesh_renderer
Commit Name: 8aaabd6dfcd2f4ae5618ef08657bbba82e8bd69f
Time: 2019-05-28
Author: david.erler@gmail.com
File Name: mesh_renderer/rasterize_triangles.py
Class Name:
Method Name: rasterize_clip_space
Project Name: deepmind/sonnet
Commit Name: ef86d2e73e7ce03c4184a04a336d96caf661269a
Time: 2017-07-03
Author: noreply@google.com
File Name: sonnet/python/modules/conv.py
Class Name: Conv1DTranspose
Method Name: _build
Project Name: uber/ludwig
Commit Name: dfbe335e866460547f97ed7ed4af0b1ad1b70bcf
Time: 2020-09-05
Author: jimthompson5802@gmail.com
File Name: ludwig/decoders/sequence_decoders.py
Class Name: SequenceGeneratorDecoder
Method Name: decoder_greedy