Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tensorflow_graphics/geometry/representation/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from __future__ import division
from __future__ import print_function

from six.moves import zip
from six.moves import zip # pyrefly: ignore[missing-source-for-stubs]
import tensorflow as tf

from tensorflow_graphics.util import export_api
Expand Down Expand Up @@ -98,7 +98,7 @@ def generate(starts, stops, nums, name="grid_generate"):
axis and from -2.0 to 2.0 with 5 subdivisions for the y axis. This lead to a
tensor of shape (3, 5, 2).
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
starts = tf.convert_to_tensor(value=starts)
stops = tf.convert_to_tensor(value=stops)
nums = tf.convert_to_tensor(value=nums)
Expand Down
4 changes: 2 additions & 2 deletions tensorflow_graphics/geometry/representation/point.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def distance_to_ray(point: type_alias.TensorLike,
ValueError: If the shape of `point`, `origin`, or 'direction' is not
supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
point = tf.convert_to_tensor(value=point)
origin = tf.convert_to_tensor(value=origin)
direction = tf.convert_to_tensor(value=direction)
Expand Down Expand Up @@ -99,7 +99,7 @@ def project_to_ray(point: type_alias.TensorLike,
ValueError: If the shape of `point`, `origin`, or 'direction' is not
supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
point = tf.convert_to_tensor(value=point)
origin = tf.convert_to_tensor(value=origin)
direction = tf.convert_to_tensor(value=direction)
Expand Down
14 changes: 7 additions & 7 deletions tensorflow_graphics/geometry/representation/ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from __future__ import print_function

from typing import Tuple, Union
from six.moves import range
from six.moves import range # pyrefly: ignore[missing-source-for-stubs]
import tensorflow as tf

from tensorflow_graphics.math import sampling
Expand Down Expand Up @@ -92,7 +92,7 @@ def sample_1d(
A tensor of shape `[A1, ..., An, M, 3]` indicating the M points on the ray
and a tensor of shape `[A1, ..., An, M]` for the Z values on the points.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
ray_org = tf.convert_to_tensor(ray_org)
ray_dir = tf.convert_to_tensor(ray_dir)
near = tf.convert_to_tensor(near) * tf.ones((1,))
Expand Down Expand Up @@ -145,7 +145,7 @@ def sample_1d(
else:
strategy_method = None

random_z_values = strategy_method(near, far, n_samples)
random_z_values = strategy_method(near, far, n_samples) # pyrefly: ignore[not-callable]
points3d = _points_from_z_values(ray_org, ray_dir, random_z_values)
return points3d, random_z_values

Expand Down Expand Up @@ -175,7 +175,7 @@ def sample_stratified_1d(
A tensor of shape `[A1, ..., An, M, 3]` indicating the M points on the ray
and a tensor of shape `[A1, ..., An, M]` for the Z values on the points.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
ray_org = tf.convert_to_tensor(ray_org)
ray_dir = tf.convert_to_tensor(ray_dir)
near = tf.convert_to_tensor(near) * tf.ones((1,))
Expand Down Expand Up @@ -245,7 +245,7 @@ def sample_inverse_transform_stratified_1d(
A tensor of shape `[A1, ..., An, M, 3]` indicating the M points on the ray
and a tensor of shape `[A1, ..., An, M]` for the Z values on the points.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
shape.check_static(
tensor=ray_org,
tensor_name="ray_org",
Expand Down Expand Up @@ -312,7 +312,7 @@ def triangulate(startpoints, endpoints, weights, name="ray_triangulate"):
Raises:
ValueError: If the shape of the arguments is not supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
startpoints = tf.convert_to_tensor(value=startpoints)
endpoints = tf.convert_to_tensor(value=endpoints)
weights = tf.convert_to_tensor(value=weights)
Expand Down Expand Up @@ -403,7 +403,7 @@ def intersection_ray_sphere(sphere_center,
`point_on_ray` is not supported.
tf.errors.InvalidArgumentError: If `ray` is not normalized.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
sphere_center = tf.convert_to_tensor(value=sphere_center)
sphere_radius = tf.convert_to_tensor(value=sphere_radius)
ray = tf.convert_to_tensor(value=ray)
Expand Down
4 changes: 2 additions & 2 deletions tensorflow_graphics/geometry/representation/triangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def normal(v0: type_alias.TensorLike,
Raises:
ValueError: If the shape of `v0`, `v1`, or `v2` is not supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
v0 = tf.convert_to_tensor(value=v0)
v1 = tf.convert_to_tensor(value=v1)
v2 = tf.convert_to_tensor(value=v2)
Expand Down Expand Up @@ -104,7 +104,7 @@ def area(v0: type_alias.TensorLike,
A tensor of shape `[A1, ..., An, 1]`, where the last dimension represents
a normalized vector.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
v0 = tf.convert_to_tensor(value=v0)
v1 = tf.convert_to_tensor(value=v1)
v2 = tf.convert_to_tensor(value=v2)
Expand Down
14 changes: 7 additions & 7 deletions tensorflow_graphics/geometry/transformation/axis_angle.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def from_euler(angles: type_alias.TensorLike,
`[A1, ..., An, 1]`, where the first tensor represents the axis, and the
second represents the angle. The resulting axis is a normalized vector.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
quaternion = quaternion_lib.from_euler(angles)
return from_quaternion(quaternion)

Expand Down Expand Up @@ -109,7 +109,7 @@ def from_euler_with_small_angles_approximation(
`[A1, ..., An, 1]`, where the first tensor represents the axis, and the
second represents the angle. The resulting axis is a normalized vector.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
quaternion = quaternion_lib.from_euler_with_small_angles_approximation(
angles)
return from_quaternion(quaternion)
Expand All @@ -136,7 +136,7 @@ def from_quaternion(quaternion: type_alias.TensorLike,
Raises:
ValueError: If the shape of `quaternion` is not supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
quaternion = tf.convert_to_tensor(value=quaternion)

shape.check_static(
Expand Down Expand Up @@ -180,7 +180,7 @@ def from_rotation_matrix(rotation_matrix: type_alias.TensorLike,
Raises:
ValueError: If the shape of `rotation_matrix` is not supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
rotation_matrix = tf.convert_to_tensor(value=rotation_matrix)

shape.check_static(
Expand Down Expand Up @@ -218,7 +218,7 @@ def inverse(axis: type_alias.TensorLike,
Raises:
ValueError: If the shape of `axis` or `angle` is not supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
axis = tf.convert_to_tensor(value=axis)
angle = tf.convert_to_tensor(value=angle)

Expand Down Expand Up @@ -256,7 +256,7 @@ def is_normalized(axis: type_alias.TensorLike,
A tensor of shape `[A1, ..., An, 1]`, where False indicates that the axis is
not normalized.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
axis = tf.convert_to_tensor(value=axis)
angle = tf.convert_to_tensor(value=angle)

Expand Down Expand Up @@ -305,7 +305,7 @@ def rotate(point: type_alias.TensorLike,
ValueError: If `point`, `axis`, or `angle` are of different shape or if
their respective shape is not supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
point = tf.convert_to_tensor(value=point)
axis = tf.convert_to_tensor(value=axis)
angle = tf.convert_to_tensor(value=angle)
Expand Down
20 changes: 10 additions & 10 deletions tensorflow_graphics/geometry/transformation/dual_quaternion.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def conjugate(dual_quaternion: type_alias.TensorLike,
Raises:
ValueError: If the shape of `dual_quaternion` is not supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
dual_quaternion = tf.convert_to_tensor(value=dual_quaternion)

shape.check_static(
Expand Down Expand Up @@ -97,7 +97,7 @@ def multiply(dual_quaternion1: type_alias.TensorLike,
Returns:
A tensor of shape `[A1, ..., An, 8]` representing dual quaternions.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
dual_quaternion1 = tf.convert_to_tensor(value=dual_quaternion1)
dual_quaternion2 = tf.convert_to_tensor(value=dual_quaternion2)

Expand Down Expand Up @@ -144,7 +144,7 @@ def inverse(dual_quaternion: type_alias.TensorLike,
Raises:
ValueError: If the shape of `dual quaternion` is not supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
dual_quaternion = tf.convert_to_tensor(value=dual_quaternion)

shape.check_static(
Expand Down Expand Up @@ -193,7 +193,7 @@ def norm(dual_quaternion: type_alias.TensorLike,
Raises:
ValueError: If the shape of `dual quaternion` is not supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
dual_quaternion = tf.convert_to_tensor(value=dual_quaternion)

shape.check_static(
Expand Down Expand Up @@ -234,7 +234,7 @@ def is_normalized(dual_quaternion: type_alias.TensorLike,
Raises:
ValueError: If the shape of `dual_quaternion` is not supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
dual_quaternion = tf.convert_to_tensor(value=dual_quaternion)

shape.check_static(
Expand Down Expand Up @@ -278,7 +278,7 @@ def from_rotation_translation(
Raises:
ValueError: If the shape of `rotation_matrix` is not supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
rotation_quaternion = tf.convert_to_tensor(value=rotation_quaternion)
translation_vector = tf.convert_to_tensor(value=translation_vector)

Expand Down Expand Up @@ -319,7 +319,7 @@ def to_rotation_translation(
A tuple with a `[A1, ..., An, 4]`-tensor for rotation in quaternion form,
and a `[A1, ..., An, 3]`-tensor for translation, in that order.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
dual_quaternion = tf.convert_to_tensor(value=dual_quaternion)

shape.check_static(
Expand Down Expand Up @@ -362,7 +362,7 @@ def from_axis_angle_translation(axis: type_alias.TensorLike,
ValueError: If the shape of `axis`, `angle`, or `translation_vector`
is not supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
axis = tf.convert_to_tensor(value=axis)
angle = tf.convert_to_tensor(value=angle)
translation_vector = tf.convert_to_tensor(value=translation_vector)
Expand Down Expand Up @@ -415,7 +415,7 @@ def conjugate_dual(
Raises:
ValueError: If the shape of `dual_quaternion` is not supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
dual_quaternion = tf.convert_to_tensor(value=dual_quaternion)

shape.check_static(
Expand All @@ -442,7 +442,7 @@ def point_to_dual_quaternion(
Returns:
The dual quaternion representation of `point`.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
point = tf.convert_to_tensor(value=point)

shape.check_static(
Expand Down
8 changes: 4 additions & 4 deletions tensorflow_graphics/geometry/transformation/euler.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def from_axis_angle(axis: type_alias.TensorLike,
A tensor of shape `[A1, ..., An, 3]`, where the last dimension represents
the three Euler angles.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
return from_quaternion(quaternion.from_axis_angle(axis, angle))


Expand Down Expand Up @@ -98,7 +98,7 @@ def gimbal_lock(r01, r02, r20, eps_addition):
angles = tf.stack((theta_x, theta_y, theta_z), axis=-1)
return angles

with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
quaternions = tf.convert_to_tensor(value=quaternions)

shape.check_static(
Expand Down Expand Up @@ -193,7 +193,7 @@ def gimbal_lock(rotation_matrix, r20, eps_addition):
angles = tf.stack((theta_x, theta_y, theta_z), axis=-1)
return angles

with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
rotation_matrix = tf.convert_to_tensor(value=rotation_matrix)

shape.check_static(
Expand Down Expand Up @@ -232,7 +232,7 @@ def inverse(euler_angle: type_alias.TensorLike,
Raises:
ValueError: If the shape of `euler_angle` is not supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
euler_angle = tf.convert_to_tensor(value=euler_angle)

shape.check_static(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def blend(points: type_alias.TensorLike,
Raises:
ValueError: If the shape of the input tensors are not supported.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
points = tf.convert_to_tensor(value=points)
skinning_weights = tf.convert_to_tensor(value=skinning_weights)
bone_rotations = tf.convert_to_tensor(value=bone_rotations)
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_graphics/geometry/transformation/look_at.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def right_handed(camera_position: type_alias.TensorLike,
A tensor of shape `[A1, ..., An, 4, 4]`, containing right handed look at
matrices.
"""
with tf.name_scope(name):
with tf.name_scope(name): # pyrefly: ignore[bad-instantiation]
camera_position = tf.convert_to_tensor(value=camera_position)
look_at = tf.convert_to_tensor(value=look_at)
up_vector = tf.convert_to_tensor(value=up_vector)
Expand Down
Loading
Loading