View source on GitHub |
Computes weights for hypercube lattice interpolation.
tfl.lattice_lib.compute_interpolation_weights(
inputs, lattice_sizes, clip_inputs=True
)
Running time: O(batch_size * prod(lattice_sizes))
If clip_inputs == True
, inputs outside of the range defined by
lattice_sizes
will be clipped into the lattice input range. If not, the
corresponding weights will linearly approach 0.0 with input moving away from
the valid input range.
Raises | |
---|---|
ValueError
|
If last dimension of inputs does not match lattice_sizes .
|
Returns | |
---|---|
Interpolation weights tensor of shape:
(batch_size, ..., prod(lattice_sizes)) .
|