AutoGraph error: OP_REQUIRES failed at strided_slice_op.cc:266

Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
No
Source
binary
TensorFlow version
2.16.1
Custom code
Yes
OS platform and distribution
Linux Ubuntu 20.04
Mobile device
No response
Python version
3.10.12
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
No response
Current behavior?
The following code works and produces the expected output when run in eager mode, but when using AutoGraph it produces bizarre error messages. The line numbers reported are not the actual location of the errors.
Replacing the contents of _safe_lookup_pixel so it always returns zeros makes the error go away, though of course the output is not then correct.
My installation is using docker image based on the NVIDIA image, details below.
Standalone code to reproduce the issue
import keras
import tensorflow as tf
import numpy as np

class UnAveragePooling2D(keras.layers.Layer):

    def __init__(self, kernel, *, strides, name = 'co1', dtype = None):
        super().__init__(trainable=True, name=name, dtype=dtype)
        self.kernel = kernel
        self.strides = strides

    def build(self, input_shape):
        pass

    def call(self, inputs):
        inputs_shape = tf.shape(inputs)

        # the averaged image had a minimum size of source.shape * strides, but it could have been larger if its size
        # was not a multiple of stride. For now, assume it was a multiple of stride.
        dest_shape = (inputs_shape[0], inputs.shape[1] * self.strides, inputs.shape[2] * self.strides, inputs_shape[3])
        dest = tf.zeros(dest_shape)

        # width of destination invalid edges that need to be filled, again assuming that source size was a multiple of stride.
        dest_start_invalid = (self.strides // 2, self.strides // 2)
        dest_end_invalid = (self.strides // 2, self.strides // 2)

        strides_f = tf.cast(self.strides, tf.float32)
        dest_start_invalid_f = (tf.cast(dest_start_invalid[0], tf.float32), tf.cast(dest_start_invalid[1], tf.float32))
        max_source_f = (tf.cast(inputs_shape[1] - 1, tf.float32), tf.cast(inputs_shape[2] - 1, tf.float32))

        # biniliear interpolation with distorted edges
        for dest_r in range(dest_shape[1]):
            for dest_c in range(dest_shape[2]):
                source_r = self._dest_to_rource(dest_r, strides_f, dest_start_invalid_f[0], max_source_f[0])
                source_c = self._dest_to_rource(dest_c, strides_f, dest_start_invalid_f[1], max_source_f[1])
                value = self._bilinear_interpolate(inputs, source_r, source_c)
                dest = self._assign_pixel_batch_values(dest, dest_r, dest_c, value)

        # # nearest edge fill
        # first_valid_row = tf.reshape(dest[:, dest_start_invalid[0], :, :], (dest_shape[0], 1, dest_shape[2], dest_shape[3]))
        # last_valid_row = tf.reshape(dest[:, -dest_end_invalid[0] - 1, :, :], (dest_shape[0], 1, dest_shape[2], dest_shape[3]))
        # start_rows = tf.tile(first_valid_row, (1, dest_start_invalid[0], 1, 1))
        # middle_rows = dest[:, dest_start_invalid[0]:-dest_end_invalid[0], :, :]
        # end_rows = tf.tile(last_valid_row, (1, dest_end_invalid[0], 1, 1))

        # dest = tf.concat([start_rows, middle_rows, end_rows], axis=1)
        # first_valid_col = tf.reshape(dest[:, :, dest_start_invalid[1], :], (dest_shape[0], dest_shape[1], 1, dest_shape[3]))
        # last_valid_col = tf.reshape(dest[:, :, -dest_end_invalid[1] - 1, :], (dest_shape[0], dest_shape[1], 1, dest_shape[3]))
        # start_cols = tf.tile(first_valid_col, (1, 1, dest_start_invalid[1], 1))
        # middle_cols = dest[:, :, dest_start_invalid[1]:-dest_end_invalid[1], :]
        # end_cols = tf.tile(last_valid_col, (1, 1, dest_end_invalid[1], 1))
        # dest = tf.concat([start_cols, middle_cols, end_cols], axis=2)

        return dest

    @tf.function
    def _dest_to_rource(self, dest, stride, dest_start_invalid, max_source):
        """Given a destination pixel row or column position, work out the source
        pixel location from which the value should be interpolated."""

        if dest < dest_start_invalid + stride - 0.5:
            return (dest - dest_start_invalid) / (stride - 0.5)
        elif dest > dest_start_invalid + (max_source - 1.0) * stride - 0.5:
            return ((dest - dest_start_invalid + 0.5) - (max_source - 1.0) * stride) / (stride - 0.5) + max_source - 1.0
        else:
            return (dest - dest_start_invalid + 0.5) / stride

    @tf.function
    def _bilinear_interpolate(self, source, r, c):
        """Given a batch of source images, interpolate each from the four pixels surrounding point r,c.
        Near the edge, fade to black.
        """
        # Algorithm (ignoring edges):
        # 1. Round r,c down to get top-right source pixel r0, c0
        # 2. Subtract r0, c0 from r, c get 0..1 proportions of a pixel fr, fc
        # 3. The four pixels to be sampled are at p00=[r0, c0], p01=[r0,c0+1], p10=[r0+1, c0], and p11=[r0+1, c0+1]
        # 4. For each channel, calculate a linear sum of the four pixels, as follows:
        # 5. result =   p00.(1-fr).(1-fc)
        #             + p01.(1-fr).fc
        #             + p10.fr.(1-fc)
        #             + p11.fr.fc
        # To cope with edges and implement fade-to-black: if any of p00, p01, p10 or p11 would be outside the source
        # image then use black instead
        r0, c0 =  tf.cast(tf.floor(r), tf.int32), tf.cast(tf.floor(c), tf.int32)
        fr, fc = r - tf.cast(r0, tf.float32), c - tf.cast(c0, tf.float32)
        p00 = self._safe_lookup_pixel(source, r0, c0)
        p01 = self._safe_lookup_pixel(source, r0, c0+1)
        p10 = self._safe_lookup_pixel(source, r0+1, c0)
        p11 = self._safe_lookup_pixel(source, r0+1, c0+1)
        return p00*(1-fr)*(1-fc) + p01*(1-fr)*fc + p10*fr*(1-fc) + p11*fr*fc

    @tf.function
    def _safe_lookup_pixel(self, source, r, c):
        """If x,y is a valid index into the source images then return the
        batch of pixels at that location, otherwise return a batch of black pixels."""

        source_shape = tf.shape(source)
        if 0 <= r < source_shape[1] and 0 <= c < source_shape[2]:
            return source[:, r, c, :]
        else:
            return tf.zeros((source_shape[0], source_shape[3]))

    @staticmethod
    @tf.function
    def _assign_pixel_batch_values(tensor, r, c, value):
        """Given a 4d tensor, replace the batch of pixels at location r,c with the given batch of pixels.
        Equivalent to tensor[:, r, c, :] = value
        """

        # There has got to be an easier way!
        tensor_shape = tensor.shape
        ret = tensor[:, :r, :, :]  # rows before the update
        new_row = tf.reshape(tensor[:, r, :c, :], (tensor_shape[0], 1, c, tensor_shape[3])) # columns before the update, on the update row
        value = tf.reshape(value, (tensor_shape[0], 1, 1, tensor_shape[3]))
        new_row = tf.concat([new_row, value], axis=2)   # append the new value
        last_cols = tf.reshape(tensor[:, r, c+1:, :], (tensor_shape[0], 1, tensor_shape[2] - c - 1, tensor_shape[3]))
        new_row = tf.concat([new_row, last_cols], axis=2) # columns after the update, on the update row
        ret = tf.concat([ret, new_row], axis=1)  # the now row with the update in it
        ret = tf.concat([ret, tensor[:, r+1:, :, :]], axis=1) # rows after the update
        return ret

TEST_SIZE = 16

data = [list(range(TEST_SIZE))] * TEST_SIZE
data = tf.convert_to_tensor(data, np.float32)
data = tf.reshape(data, (1, TEST_SIZE, TEST_SIZE, 1))

model = keras.models.Sequential()
model.add(keras.layers.AveragePooling2D((6, 6), padding='same', strides=4))
model.add(UnAveragePooling2D((6, 6), strides=4))
model.compile(run_eagerly=False)

expanded = model.predict(data)
print(expanded[0,:,:,0])

Dockerfile:
FROM nvcr.io/nvidia/tensorflow:24.06-tf2-py3 AS base_image
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
    wget \
    build-essential \
    cmake \
    git \
    unzip \
    pkg-config
WORKDIR /environment
RUN pip install --upgrade pip
RUN pip install -U numpy protobuf tensorflow-datasets tensorflow_graphics keras scikit-learn scikit-image pandas seaborn jupyter keras-tuner openml opencv-python typing-extensions pydot graphviz data-science-types adjustText
RUN apt-get update && apt-get install -y \
    graphviz
EXPOSE 8888
ENTRYPOINT ["jupyter", "notebook", "--no-browser","--ip=<IP_ADDRESS>"]

### Relevant log output

```shell
2024-09-06 17:35:56.430840: W tensorflow/core/framework/op_kernel.cc:1839] OP_REQUIRES failed at strided_slice_op.cc:266 : INVALID_ARGUMENT: slice index 4 of dimension 1 out of bounds.

Stack trace for op definition:
File "usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
File "usr/lib/python3.10/runpy.py", line 86, in _run_code
File "usr/local/lib/python3.10/dist-packages/ipykernel_launcher.py", line 18, in <module>
File "usr/local/lib/python3.10/dist-packages/traitlets/config/application.py", line 1043, in launch_instance
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py", line 739, in start
File "usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py", line 205, in start
File "usr/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
File "usr/lib/python3.10/asyncio/base_events.py", line 1909, in _run_once
File "usr/lib/python3.10/asyncio/events.py", line 80, in _run
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 545, in dispatch_queue
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 534, in process_one
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 437, in dispatch_shell
File "usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py", line 362, in execute_request
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 778, in execute_request
File "usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py", line 449, in do_execute
File "usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py", line 549, in run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3051, in run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3106, in _run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py", line 129, in _pseudo_sync_runner
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3311, in run_cell_async
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3493, in run_ast_nodes
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3553, in run_code
File "tmp/ipykernel_2107/74085429.py", line 137, in <module>
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 508, in predict
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 208, in one_step_on_data_distributed
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 198, in one_step_on_data
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 96, in predict_step
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 807, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 1315, in _maybe_build
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 225, in build_wrapper
File "usr/local/lib/python3.10/dist-packages/keras/src/models/sequential.py", line 183, in build
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 882, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 46, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 156, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 58, in symbolic_call
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 1047, in compute_output_spec
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 78, in compute_output_spec
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/core.py", line 200, in compute_output_spec
File "tmp/ipykernel_2107/74085429.py", line 38, in call
File "tmp/ipykernel_2107/3701247216.py", line 88, in _bilinear_interpolate
File "tmp/ipykernel_2107/2303768048.py", line 100, in _safe_lookup_pixel
File "tmp/ipykernel_2107/2303768048.py", line 101, in _safe_lookup_pixel

2024-09-06 17:35:56.430922: W tensorflow/core/framework/op_kernel.cc:1839] OP_REQUIRES failed at if_op.cc:269 : INVALID_ARGUMENT: slice index 4 of dimension 1 out of bounds.

Stack trace for op definition:
File "usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
File "usr/lib/python3.10/runpy.py", line 86, in _run_code
File "usr/local/lib/python3.10/dist-packages/ipykernel_launcher.py", line 18, in <module>
File "usr/local/lib/python3.10/dist-packages/traitlets/config/application.py", line 1043, in launch_instance
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py", line 739, in start
File "usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py", line 205, in start
File "usr/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
File "usr/lib/python3.10/asyncio/base_events.py", line 1909, in _run_once
File "usr/lib/python3.10/asyncio/events.py", line 80, in _run
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 545, in dispatch_queue
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 534, in process_one
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 437, in dispatch_shell
File "usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py", line 362, in execute_request
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 778, in execute_request
File "usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py", line 449, in do_execute
File "usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py", line 549, in run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3051, in run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3106, in _run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py", line 129, in _pseudo_sync_runner
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3311, in run_cell_async
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3493, in run_ast_nodes
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3553, in run_code
File "tmp/ipykernel_2107/74085429.py", line 137, in <module>
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 508, in predict
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 208, in one_step_on_data_distributed
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 198, in one_step_on_data
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 96, in predict_step
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 807, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 1315, in _maybe_build
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 225, in build_wrapper
File "usr/local/lib/python3.10/dist-packages/keras/src/models/sequential.py", line 183, in build
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 882, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 46, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 156, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 58, in symbolic_call
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 1047, in compute_output_spec
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 78, in compute_output_spec
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/core.py", line 200, in compute_output_spec
File "tmp/ipykernel_2107/74085429.py", line 38, in call
File "tmp/ipykernel_2107/3701247216.py", line 88, in _bilinear_interpolate
File "tmp/ipykernel_2107/2303768048.py", line 100, in _safe_lookup_pixel
File "tmp/ipykernel_2107/2303768048.py", line 101, in _safe_lookup_pixel

	 [[{{node cond_2/strided_slice}}]]
	tf2xla conversion failed while converting cond_2_true_603071_const_1002[]. Run with TF_DUMP_GRAPH_PREFIX=/path/to/dump/dir and --vmodule=xla_compiler=2 to obtain a dump of the compiled functions.

Stack trace for op definition:
File "usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
File "usr/lib/python3.10/runpy.py", line 86, in _run_code
File "usr/local/lib/python3.10/dist-packages/ipykernel_launcher.py", line 18, in <module>
File "usr/local/lib/python3.10/dist-packages/traitlets/config/application.py", line 1043, in launch_instance
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py", line 739, in start
File "usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py", line 205, in start
File "usr/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
File "usr/lib/python3.10/asyncio/base_events.py", line 1909, in _run_once
File "usr/lib/python3.10/asyncio/events.py", line 80, in _run
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 545, in dispatch_queue
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 534, in process_one
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 437, in dispatch_shell
File "usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py", line 362, in execute_request
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 778, in execute_request
File "usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py", line 449, in do_execute
File "usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py", line 549, in run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3051, in run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3106, in _run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py", line 129, in _pseudo_sync_runner
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3311, in run_cell_async
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3493, in run_ast_nodes
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3553, in run_code
File "tmp/ipykernel_2107/74085429.py", line 137, in <module>
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 508, in predict
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 208, in one_step_on_data_distributed
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 198, in one_step_on_data
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 96, in predict_step
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 807, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 1315, in _maybe_build
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 225, in build_wrapper
File "usr/local/lib/python3.10/dist-packages/keras/src/models/sequential.py", line 183, in build
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 882, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 46, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 156, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 58, in symbolic_call
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 1047, in compute_output_spec
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 78, in compute_output_spec
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/core.py", line 200, in compute_output_spec
File "tmp/ipykernel_2107/74085429.py", line 38, in call
File "tmp/ipykernel_2107/3701247216.py", line 88, in _bilinear_interpolate
File "tmp/ipykernel_2107/2303768048.py", line 100, in _safe_lookup_pixel

2024-09-06 17:35:56.593132: W tensorflow/core/framework/op_kernel.cc:1839] OP_REQUIRES failed at xla_ops.cc:580 : INVALID_ARGUMENT: slice index 4 of dimension 1 out of bounds.

Stack trace for op definition:
File "usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
File "usr/lib/python3.10/runpy.py", line 86, in _run_code
File "usr/local/lib/python3.10/dist-packages/ipykernel_launcher.py", line 18, in <module>
File "usr/local/lib/python3.10/dist-packages/traitlets/config/application.py", line 1043, in launch_instance
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py", line 739, in start
File "usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py", line 205, in start
File "usr/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
File "usr/lib/python3.10/asyncio/base_events.py", line 1909, in _run_once
File "usr/lib/python3.10/asyncio/events.py", line 80, in _run
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 545, in dispatch_queue
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 534, in process_one
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 437, in dispatch_shell
File "usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py", line 362, in execute_request
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 778, in execute_request
File "usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py", line 449, in do_execute
File "usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py", line 549, in run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3051, in run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3106, in _run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py", line 129, in _pseudo_sync_runner
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3311, in run_cell_async
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3493, in run_ast_nodes
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3553, in run_code
File "tmp/ipykernel_2107/74085429.py", line 137, in <module>
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 508, in predict
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 208, in one_step_on_data_distributed
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 198, in one_step_on_data
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 96, in predict_step
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 807, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 1315, in _maybe_build
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 225, in build_wrapper
File "usr/local/lib/python3.10/dist-packages/keras/src/models/sequential.py", line 183, in build
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 882, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 46, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 156, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 58, in symbolic_call
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 1047, in compute_output_spec
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 78, in compute_output_spec
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/core.py", line 200, in compute_output_spec
File "tmp/ipykernel_2107/74085429.py", line 38, in call
File "tmp/ipykernel_2107/3701247216.py", line 88, in _bilinear_interpolate
File "tmp/ipykernel_2107/2303768048.py", line 100, in _safe_lookup_pixel
File "tmp/ipykernel_2107/2303768048.py", line 101, in _safe_lookup_pixel

	 [[{{node cond_2/strided_slice}}]]
	tf2xla conversion failed while converting cond_2_true_603071_const_1002[]. Run with TF_DUMP_GRAPH_PREFIX=/path/to/dump/dir and --vmodule=xla_compiler=2 to obtain a dump of the compiled functions.

Stack trace for op definition:
File "usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
File "usr/lib/python3.10/runpy.py", line 86, in _run_code
File "usr/local/lib/python3.10/dist-packages/ipykernel_launcher.py", line 18, in <module>
File "usr/local/lib/python3.10/dist-packages/traitlets/config/application.py", line 1043, in launch_instance
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py", line 739, in start
File "usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py", line 205, in start
File "usr/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
File "usr/lib/python3.10/asyncio/base_events.py", line 1909, in _run_once
File "usr/lib/python3.10/asyncio/events.py", line 80, in _run
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 545, in dispatch_queue
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 534, in process_one
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 437, in dispatch_shell
File "usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py", line 362, in execute_request
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 778, in execute_request
File "usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py", line 449, in do_execute
File "usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py", line 549, in run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3051, in run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3106, in _run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py", line 129, in _pseudo_sync_runner
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3311, in run_cell_async
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3493, in run_ast_nodes
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3553, in run_code
File "tmp/ipykernel_2107/74085429.py", line 137, in <module>
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 508, in predict
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 208, in one_step_on_data_distributed
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 198, in one_step_on_data
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 96, in predict_step
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 807, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 1315, in _maybe_build
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 225, in build_wrapper
File "usr/local/lib/python3.10/dist-packages/keras/src/models/sequential.py", line 183, in build
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 882, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 46, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 156, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 58, in symbolic_call
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 1047, in compute_output_spec
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 78, in compute_output_spec
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/core.py", line 200, in compute_output_spec
File "tmp/ipykernel_2107/74085429.py", line 38, in call
File "tmp/ipykernel_2107/3701247216.py", line 88, in _bilinear_interpolate
File "tmp/ipykernel_2107/2303768048.py", line 100, in _safe_lookup_pixel

	 [[sequential_75_1/co1_1/PartitionedCall_1002/PartitionedCall_2/cond_2]]
	tf2xla conversion failed while converting __inference_one_step_on_data_615470[]. Run with TF_DUMP_GRAPH_PREFIX=/path/to/dump/dir and --vmodule=xla_compiler=2 to obtain a dump of the compiled functions.
2024-09-06 17:35:56.593189: W tensorflow/core/framework/local_rendezvous.cc:404] Local rendezvous is aborting with status: INVALID_ARGUMENT: slice index 4 of dimension 1 out of bounds.

Stack trace for op definition:
File "usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
File "usr/lib/python3.10/runpy.py", line 86, in _run_code
File "usr/local/lib/python3.10/dist-packages/ipykernel_launcher.py", line 18, in <module>
File "usr/local/lib/python3.10/dist-packages/traitlets/config/application.py", line 1043, in launch_instance
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py", line 739, in start
File "usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py", line 205, in start
File "usr/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
File "usr/lib/python3.10/asyncio/base_events.py", line 1909, in _run_once
File "usr/lib/python3.10/asyncio/events.py", line 80, in _run
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 545, in dispatch_queue
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 534, in process_one
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 437, in dispatch_shell
File "usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py", line 362, in execute_request
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 778, in execute_request
File "usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py", line 449, in do_execute
File "usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py", line 549, in run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3051, in run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3106, in _run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py", line 129, in _pseudo_sync_runner
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3311, in run_cell_async
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3493, in run_ast_nodes
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3553, in run_code
File "tmp/ipykernel_2107/74085429.py", line 137, in <module>
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 508, in predict
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 208, in one_step_on_data_distributed
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 198, in one_step_on_data
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 96, in predict_step
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 807, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 1315, in _maybe_build
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 225, in build_wrapper
File "usr/local/lib/python3.10/dist-packages/keras/src/models/sequential.py", line 183, in build
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 882, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 46, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 156, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 58, in symbolic_call
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 1047, in compute_output_spec
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 78, in compute_output_spec
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/core.py", line 200, in compute_output_spec
File "tmp/ipykernel_2107/74085429.py", line 38, in call
File "tmp/ipykernel_2107/3701247216.py", line 88, in _bilinear_interpolate
File "tmp/ipykernel_2107/2303768048.py", line 100, in _safe_lookup_pixel
File "tmp/ipykernel_2107/2303768048.py", line 101, in _safe_lookup_pixel

	 [[{{node cond_2/strided_slice}}]]
	tf2xla conversion failed while converting cond_2_true_603071_const_1002[]. Run with TF_DUMP_GRAPH_PREFIX=/path/to/dump/dir and --vmodule=xla_compiler=2 to obtain a dump of the compiled functions.

Stack trace for op definition:
File "usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
File "usr/lib/python3.10/runpy.py", line 86, in _run_code
File "usr/local/lib/python3.10/dist-packages/ipykernel_launcher.py", line 18, in <module>
File "usr/local/lib/python3.10/dist-packages/traitlets/config/application.py", line 1043, in launch_instance
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py", line 739, in start
File "usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py", line 205, in start
File "usr/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
File "usr/lib/python3.10/asyncio/base_events.py", line 1909, in _run_once
File "usr/lib/python3.10/asyncio/events.py", line 80, in _run
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 545, in dispatch_queue
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 534, in process_one
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 437, in dispatch_shell
File "usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py", line 362, in execute_request
File "usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 778, in execute_request
File "usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py", line 449, in do_execute
File "usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py", line 549, in run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3051, in run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3106, in _run_cell
File "usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py", line 129, in _pseudo_sync_runner
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3311, in run_cell_async
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3493, in run_ast_nodes
File "usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3553, in run_code
File "tmp/ipykernel_2107/74085429.py", line 137, in <module>
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 508, in predict
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 208, in one_step_on_data_distributed
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 198, in one_step_on_data
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/trainer.py", line 96, in predict_step
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 807, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 1315, in _maybe_build
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 225, in build_wrapper
File "usr/local/lib/python3.10/dist-packages/keras/src/models/sequential.py", line 183, in build
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 882, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 117, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 46, in __call__
File "usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 156, in error_handler
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 58, in symbolic_call
File "usr/local/lib/python3.10/dist-packages/keras/src/layers/layer.py", line 1047, in compute_output_spec
File "usr/local/lib/python3.10/dist-packages/keras/src/ops/operation.py", line 78, in compute_output_spec
File "usr/local/lib/python3.10/dist-packages/keras/src/backend/tensorflow/core.py", line 200, in compute_output_spec
File "tmp/ipykernel_2107/74085429.py", line 38, in call
File "tmp/ipykernel_2107/3701247216.py", line 88, in _bilinear_interpolate
File "tmp/ipykernel_2107/2303768048.py", line 100, in _safe_lookup_pixel

	 [[sequential_75_1/co1_1/PartitionedCall_1002/PartitionedCall_2/cond_2]]
	tf2xla conversion failed while converting __inference_one_step_on_data_615470[]. Run with TF_DUMP_GRAPH_PREFIX=/path/to/dump/dir and --vmodule=xla_compiler=2 to obtain a dump of the compiled functions.
	 [[PartitionedCall]]

Here is a different (and simpler) version of the code. This version works in AutoGraph mode in TensorFlow 2.13.1 on Python 3.8.10, but produces the above error when run in TensorFlow 2.16.1 on Python 3.10.12.
import keras
import tensorflow as tf
import numpy as np

class UnAveragePooling2D(keras.layers.Layer):

    def __init__(self, kernel, *, strides, name = 'co1', dtype = None):
        super().__init__(trainable=True, name=name, dtype=dtype)
        self.kernel = kernel
        self.strides = strides

    def build(self, input_shape):
        pass

    def call(self, inputs):
        inputs_shape = tf.shape(inputs)

        # the averaged image had a minimum size of source.shape * strides, but it could have been larger if its size
        # was not a multiple of stride. For now, assume it was a multiple of stride.
        dest_shape = (inputs_shape[0], inputs.shape[1] * self.strides, inputs.shape[2] * self.strides, inputs_shape[3])
        #dest = tf.zeros(dest_shape)

        # width of destination invalid edges that need to be filled, again assuming that source size was a multiple of stride.
        dest_start_invalid = (self.strides // 2, self.strides // 2)
        dest_end_invalid = (self.strides // 2, self.strides // 2)

        strides_f = tf.cast(self.strides, tf.float32)
        dest_start_invalid_f = (tf.cast(dest_start_invalid[0], tf.float32), tf.cast(dest_start_invalid[1], tf.float32))
        max_source_f = (tf.cast(inputs.shape[1] - 1, tf.float32), tf.cast(inputs.shape[2] - 1, tf.float32))

        # biniliear interpolation with distorted edges
        dest = tf.zeros((dest_shape[0], 0, dest_shape[2], dest_shape[3]))
        for dest_r in range(dest_shape[1]):
            dest_r_f = tf.cast(dest_r, tf.float32)
            row = tf.zeros((dest_shape[0], 1, 0, dest_shape[3]))
            for dest_c in range(dest_shape[2]):
                dest_c_f = tf.cast(dest_c, tf.float32)
                source_r = self._dest_to_rource(dest_r_f, strides_f, dest_start_invalid_f[0], max_source_f[0])
                source_c = self._dest_to_rource(dest_c_f, strides_f, dest_start_invalid_f[1], max_source_f[1])
                value = self._bilinear_interpolate(inputs, source_r, source_c)
                #dest = self._assign_pixel_batch_values(dest, dest_r, dest_c, value)
                value = tf.reshape(value, (inputs_shape[0], 1, 1, inputs_shape[3]))
                row = tf.concat([row, value], axis=2)
            dest = tf.concat([dest, row], axis=1)

        return dest

    @tf.function
    def _dest_to_rource(self, dest, stride, dest_start_invalid, max_source):
        """Given a destination pixel row or column position, work out the source
        pixel location from which the value should be interpolated."""

        if dest < dest_start_invalid + stride - 0.5:
            return (dest - dest_start_invalid) / (stride - 0.5)
        elif dest > dest_start_invalid + (max_source - 1.0) * stride - 0.5:
            return ((dest - dest_start_invalid + 0.5) - (max_source - 1.0) * stride) / (stride - 0.5) + max_source - 1.0
        else:
            return (dest - dest_start_invalid + 0.5) / stride

    @tf.function
    def _bilinear_interpolate(self, source, r, c):
        """Given a batch of source images, interpolate each from the four pixels surrounding point r,c.
        Near the edge, fade to black.
        """
        # Algorithm (ignoring edges):
        # 1. Round r,c down to get top-right source pixel r0, c0
        # 2. Subtract r0, c0 from r, c get 0..1 proportions of a pixel fr, fc
        # 3. The four pixels to be sampled are at p00=[r0, c0], p01=[r0,c0+1], p10=[r0+1, c0], and p11=[r0+1, c0+1]
        # 4. For each channel, calculate a linear sum of the four pixels, as follows:
        # 5. result =   p00.(1-fr).(1-fc)
        #             + p01.(1-fr).fc
        #             + p10.fr.(1-fc)
        #             + p11.fr.fc
        # To cope with edges and implement fade-to-black: if any of p00, p01, p10 or p11 would be outside the source
        # image then use black instead
        r0, c0 =  tf.cast(tf.floor(r), tf.int32), tf.cast(tf.floor(c), tf.int32)
        fr, fc = r - tf.cast(r0, tf.float32), c - tf.cast(c0, tf.float32)
        p00 = self._safe_lookup_pixel(source, r0, c0)
        p01 = self._safe_lookup_pixel(source, r0, c0+1)
        p10 = self._safe_lookup_pixel(source, r0+1, c0)
        p11 = self._safe_lookup_pixel(source, r0+1, c0+1)
        return p00*(1-fr)*(1-fc) + p01*(1-fr)*fc + p10*fr*(1-fc) + p11*fr*fc

    @tf.function
    def _safe_lookup_pixel(self, source, r, c):
        """If x,y is a valid index into the source images then return the
        batch of pixels at that location, otherwise return a batch of black pixels."""

        source_shape = tf.shape(source)
        if 0 <= r < source.shape[1] and 0 <= c < source.shape[2]:
            return source[:, r, c, :]
        else:
            return tf.zeros((source_shape[0], source_shape[3]))

TEST_SIZE = 16

data = [list(range(TEST_SIZE))] * TEST_SIZE
data = tf.convert_to_tensor(data, np.float32)
data = tf.reshape(data, (1, TEST_SIZE, TEST_SIZE, 1))

model = keras.models.Sequential()
model.add(keras.Input(shape=(TEST_SIZE, TEST_SIZE, 1), batch_size=1))
model.add(keras.layers.AveragePooling2D((6, 6), padding='same', strides=4))
model.add(UnAveragePooling2D((6, 6), strides=4))
model.compile(run_eagerly=False)

expanded = model.predict(data)
print(expanded[0,:,:,0])

@richardwhitehead,
I tried to execute the code on the latest tensorflow v2.17 and it was executed without any issues. Kindly find the gist of it here and try to update to 2.17. Thank you!

Thank you very much for investigating this.
I tried updating my docker container to the latest version provided by NVIDIA (24.09-tf2-py3) but that still seems to be TensorFlow v2.16.1.
Having lost many days fighting version incompatibilities in the past, and given that Nvidia has chosen not to upgrade yet, I am unwilling to try updating TensorFlow and will wait until Nvidia release a container image with a newer version.
I have no doubt that what you say is true and so please feel free to close the issue.
Many thanks,
Richard
From: tilakrayal @.>
Sent: 25 September 2024 15:45
To: tensorflow/tensorflow @.>
Cc: richardwhitehead @.>; Mention @.>
Subject: Re: [tensorflow/tensorflow] AutoGraph error: OP_REQUIRES failed at strided_slice_op.cc:266 (Issue #75269)
@richardwhitehead https://github.com/richardwhitehead ,
I tried to execute the code on the latest tensorflow v2.17 and it was executed without any issues. Kindly find the gist of it here https://colab.research.google.com/gist/tilakrayal/08d84020487a9abf51ada4c68c8528e2/untitled2127.ipynb  and try to update to 2.17. Thank you!
—
Reply to this email directly, view it on GitHub https://github.com/tensorflow/tensorflow/issues/75269#issuecomment-2374305020 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AFPFJLO55UDEAFUZKEUQPRLZYLD7HAVCNFSM6AAAAABNZAI4P2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZUGMYDKMBSGA .
You are receiving this because you were mentioned.  https://github.com/notifications/beacon/AFPFJLI33D7PIOQGCMFSAGDZYLD7HA5CNFSM6AAAAABNZAI4P2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUNQUCPY.gif Message ID: @.*** @.***> >

@richardwhitehead,
Glad the issue was resolved. Could you please feel free to move this issue to closed status. Thank you!

Fixed in v2.17


Could not find webrtc dependency on jitpack

Describe the bug
Build failure when new version of webrtc released. Maybe livekit client SDK should use already builded dependency of webrtc to avoid this problem?
To Reproduce
Steps to reproduce the behavior:

Clear build of project

Expected behavior
Successful build
Screenshots

Update to latest.
See #204.


Implementing relation ship

can i make relation ship between collections easily?

Sorry for the delay, I will check this on on thursday morning.

Any news on this one?

@Nefiron  i dont think

Have you found a solution?
Have you tried the Query Population method ?
Here from the Mongorito Docs
Maybe this is a workaround for your Problem

@MahdiPishguy If you check the package code, it's only a simple integration to Mongorito package.
Then, things like relations or how I can query like something, the anwser probably will be on Mongorito Docs :)
@Nefiron @NicoG11


fix jwt memory leak

This should fix #11

Thanks for Contributing, I will review your PR a soon as possible.

Cherrypicked your commit to "dev" and "master", thanks again for contributing ! :slightly_smiling_face:
PS: There is a misunderstanding about the "dev" branch purpose, I will clarify it in the readme.


Travis dockerbuild

As discussed in https://sebest.github.io/post/using-travis-ci-to-build-docker-images/

A (foreign) pull request cannot auto-deploy to dockerhub, so merging in, we'll see if it does on master:
https://twitter.com/braincode/status/793873457486397441


Missing Jetty 1.0 (June 1995)

Don't have omnigraffle, can't submit patch.

Timeline starts in 1999. I'm currently not interested in adding anything before then, though I do mention it in talks.


Draft: created cheatsheet-prompt.py and cheatsheet-generator.py script

I encountered issues while running the cheatsheet-generator.py script, specifically a ModuleNotFoundError for the cheatsheet_prompt module. Despite ensuring both scripts are in the same directory, the error persists. I also added current directory to sys.path, to ensure the cheatsheet_prompt module is correctly located and imported.

It looks like you named the file cheatsheet-prompt.py but are trying to import cheatsheet_prompt. Is the underscore versus dash causing the problem?

Using GPT-4o, it seems like you just need to change the name of your file to use underscores.  A - is not a valid character in a module name.

That might be the cause. It was an oversight. I'll make the change and run it again.
Thank you

When you are ready to submit things, feel free to convert this back to open from a draft.

I've created cheatsheets for linalg and ma modules in separate notebooks. I made use of groqs to create them. Here is the system message I used.
Create a cheatsheet that captures the essential details of the functions in a particular numpy module. The cheatsheet should include Function Description, Parameters, Returns, and Examples. Use markdown format for the cheatsheet, with headers for each section. Use the Pandas cheatsheet template style to create this.

As I look at the code for the Jupyter notebooks, I'm noticing that all your work is inside Markdown cells, which means none of the code chunks will run. Is that what you wanted? I think having examples that you can interact with is better, if you're going to use Jupyter notebooks.

Right, I also thought about that. But on a send thought, I felt the whole idea about cheatsheet is to give users quick-reference to essential information, tips, or formulas to help them recall key concepts, formulas, or procedures.
Since making it interactive will be cool. I'll create additional code cell under each function for example. Thanks for this idea Ben.


feat: create user package and signer class

Ref: https://github.com/celestiaorg/celestia-app/pull/2238
Creates a user package based from the the KeyringSigner in the blob module. A future PR will refactor the tests and remove the KeyringSigner

Codecov Report

Merging #2275 (83012f5) into main (35c4b0e) will decrease coverage by 0.44%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #2275      +/-   ##
==========================================
- Coverage   21.72%   21.29%   -0.44%
==========================================
  Files         129      131       +2
  Lines       14453    14748     +295
==========================================
  Hits         3140     3140
- Misses      11008    11303     +295
  Partials      305      305

Files Changed
Coverage Δ

pkg/user/signer.go
0.00% <0.00%> (ø)

pkg/user/tx_options.go
0.00% <0.00%> (ø)


Imperial Rome doesn't get focus tree

When playing other countries, Imperial Rome gets a default focus tree which causes it to do nothing of significance if it wins the civil war

Vanilla should have an example of how to restore the focus tree after a civil war. Most civil war countries get the generic tree until after the war is over, then it's restored by an on_action.


Disable/enable features

Is it possible to specifically disable/enable features of Ketcher 2.0?

Hello @Doidel ,
At this moment Ketcher does not support disabling of any  features but in the future we plan to provide possibility to choose the list of features while building the app (or configuring  component if you use npm package).
Could you provide the list of features that you  want to disable?
Best regards,
Ketcher team

Hi @AndreiMazol and thanks for the instant reply.
No problem, thanks for letting me know.
Disabling features would probably be a temporary measure in our case. I can elaborate a bit:
The nginx reverse proxy in front of the Docker service is something we couldn't do yet because of missing prerequisites (nested virtualization, open deployment questions, etc..). So in order to demo the Ketcher editor within our application to the upper management, I reverse engineered the API in our existing C# service, but just the "layout" and "info" APIs (so we can convert SMILES to molfiles). As a result, the other functionalities of Ketcher are throwing errors, so we wanted to hide them before showing Ketcher to the management.

@Doidel , thank  you for  the explanation.
Anyway, adding this functionality is in our plans.
Please contact us if you have any questions or suggestions about further Ketcher enhancements.  We will be happy to take care about all your isssues.
Best regards,
Ketcher team


Updating all SDKs after changes to API_Specs

Paul, please regenerate API_Spec. We fixed a bug in doc gen and API metadata gen during the weekend. Sorry for the inconvenience.
It looks like this change is not affected by the bug. But just in case.


Update Babel to add support for Typescript 4.9

Importing tsx files break at runtime because with the error SyntaxError: Unexpected identifier 'satisfies'  because satisfies operator is not properly removed.
Babel added support for it in version 7.20 https://babeljs.io/blog/2022/10/27/7.20.0

Assuming 7.20 isn't breaking wouldn't people just update their projects. Babel is just a peer dep here.

You are right, there are issues with npm package manager updating transitive babel dependencies, so manually updating my lock file worked. This wasn't dom-expression issue, thanks again.


Node/Mongo container - yarn isn't install in web container

VSCode Version: 1.48.0
Local OS Version: Windows 10 Enterprise 10.0.19041 Build 19041
Remote OS Version: mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} - variant == 12
Remote Extension/Connection Type: Docker

Steps to Reproduce:

Git clone https://github.com/Microsoft/TypeScript-Node-Starter
Change devcontainer.json to forward port 3000 and post command = "yarn install && yarn run"
Run node/mongo container from remote extension
Try http://localhost:3000 to get to website -> error
Try "yarn run" at vscode container terminal -> yarn isn't installed

I expect that if the devcontainer.json shows yarn even though it is commented out, then I expect yarn to be in the container.

Does this issue occur when you try this locally?: Yes/No
Does this issue occur when you try this locally and all extensions are disabled?: Yes/No

I don't think the postInstall command is working very well and yes, you are correct yarn is there - it eventually work. Closing.


Consider adding is_distinct_from kernels

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Several databases have is distinct from and is not distinct from operators in addition to = and !=.
We have added this function in DataFusion -- see https://github.com/apache/arrow-datafusion/pull/1117 from @Dandandan   and https://github.com/apache/arrow-datafusion/pull/1163
The is distinct from operator differs in how nulls are handled
From the Postgres manual
https://www.postgresql.org/docs/14/functions-comparison.html
datatype IS DISTINCT FROM datatype → boolean
Not equal, treating null as a comparable value.
1 IS DISTINCT FROM NULL → t (rather than NULL)
NULL IS DISTINCT FROM NULL → f (rather than NULL)
--
datatype IS NOT DISTINCT FROM datatype → boolean
Equal, treating null as a comparable value.
1 IS NOT DISTINCT FROM NULL → f (rather than NULL)
NULL IS NOT DISTINCT FROM NULL → t (rather than NULL)

Describe the solution you'd like
We propose bringing the implementations from DataFusion into the arrow-rs crate
This would look like implementing kernels is_distinct_from, is_distinct_from_scalar, is_not_distinct_from, and is_not_distinct_from_scalar
Ideally starting from the implementatons in https://github.com/apache/arrow-datafusion/pull/1117 and https://github.com/apache/arrow-datafusion/pull/1163 and modifying them to follow the pattern demonstrated in @Dandandan 's pr for eq_bool https://github.com/apache/arrow-rs/pull/844 -- namely doing the comparisons in 64-bit chunks when possible.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.

I can try it

Hi @tustvold would you like me to add and test the code from https://github.com/apache/arrow-datafusion/pull/4560#issuecomment-1344393843

If you could that would be awesome, one detail I omitted there is consistently handling floats using total ordering. I suspect this will involve comparing primitives using ArrowNativeTypeOp instead of PartialCmp.
I have some half-baked ideas on how to do this, so if you just want to add and test the PartialCmp based impl, that would also be fine 😀


Dynamic SSL configuration does not take effect

Summary
Dynamic SSL does not update.  Instead, continues to serve up default cert for kong .  Same as this issue, which was closed without any explanation as to why.
Steps To Reproduce

create a service:

curl -i -X POST --url http://localhost:8001/apis/ --data 'name=test' --data 'upstream_url=http://test.service.consul/' --data 'request_host=test.myhost.bz'

update the endpoint with my certs:

curl -X POST --url http://localhost:8001/apis/test/plugins --form "name=ssl" --form<EMAIL_ADDRESS>--form<EMAIL_ADDRESS>--form "config.only_https=true"

curl the service and get the default cert for my kong instance (*.myhost.com), instead of my *.myhost.bz certificate:

❯ curl -k -v https://xxx.xxx.xxx.xxx -H "Host: test.myhost.bz"

* Rebuilt URL to: https://xxx.xxx.xxx.xxx/
*   Trying xxx.xxx.xxx.xxx...
* TCP_NODELAY set
* Connected to xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate: *.myhost.com
* Server certificate: DigiCert SHA2 Secure Server CA
* Server certificate: DigiCert Global Root CA

You'll notice the server responds with *.myhost.com instead of *.myhost.bz.
I don't see any logs saying the certificate is invalid, and when I look at localhost:8001/plugins I can see my plugin loaded and enabled.  The certificate I loaded contains the intermediate cert - so the whole chain is present.
Additional Details & Logs
Using Kong in Docker.  Started with the following run command:
docker run -d --name kong --net host -e "KONG_DATABASE=cassandra" -e "KONG_CASSANDRA_CONTACT_POINTS=xxx.xxx.xxx.xxx" -e "KONG_CASSANDRA_PORT=9042" -e "KONG_ADMIN_LISTEN=xxx.xxx.xxx.xxx:8001" -e "KONG_PROXY_LISTEN=<IP_ADDRESS>:80" -e "KONG_PROXY_LISTEN_SSL=<IP_ADDRESS>:443" -e "KONG_SSL_CERT=/ssl/wildcard.myhost.com.crt" -e "KONG_SSL_CERT_KEY=/ssl/wildcard.myhost.com.key" -e "KONG_DNSMASQ=off" -e "KONG_DNS_RESOLVER=xxx.xxx.xxx.xxx" -p 80:80 -p 443:443 -p 8001:8001 -p 7946:7946 -p 7946:7946/udp -v $(pwd)/ssl:/ssl kong

Hi,
Your client needs to support SNI. I believe curl is performing the client hello with the host provided in the URL. I am not sure how to enforce a custom SNI from curl, but it seems that online resources point to using the --resolve option. Could you give it a try?

Ah, you're right!  I added a quick entry to /etc/hosts and did the curl again and it served the correct cert.  Appreciate the quick reply!

@cookandy Can you spell-out what you changed in /etc/hosts, please? I am working through a similar problem.

Hi @tpanagos,
In my case, I added a entry in my local /etc/hosts file (on the machine I ran curl from) with the IP address of kong, and the hostname I set with request_host in kong (and Host: in curl):
# cat /etc/hosts

xxx.xxx.xxx.xxx   test.myhost.bz

and then run curl again (this time no need to set Host header):
❯ curl -k -v "https://test.myhost.bz"


feat: make emptiness controller aware of scheduling

Description
This eliminates some problems seen with short emptiness TTL
where we can delete the node too early (e.g. PVC binding) and
the 'boucing' of the emptiness annotation for newly launched nodes.

How was this change tested?

Unit tests & make e2etests

Does this change impact docs?

[ ] Yes, PR includes docs updates
[ ] Yes, issue opened: #
[X] No

Release Note

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This simplifies consolidation a good amount while also eliminating the bouncing emptiness TTL that we currently see when nodes launch.

Nice!!


Allow PHP-style [] in query strings

PHP encodes arrays in query strings using square brackets. This goes
against the spec, but PHP ain't got no time for your spec poindexter.
This is a minimal change that only allows square brackets in keys and
values. Arguably a more permissive parser (allowing any non-separator or
terminator character in keys and values) would be better for the wild
and crazy world we call the web.

:+1:
This looks good to me. I'll merge this tomorrow unless somebody objects.

I think Ruby frameworks do this too, but it makes me too sad to go look.  :+1:


Getting ExpiredTokenException even though I'm refreshing the token when cache expires.

Hello, first of all thanks for this gem! It's great so far and I'm looking forward to exploring more features.
I am running into an issue where ever so often (usually about 1-2 hours) something is going wrong and I'm getting an ExpiredTokenException.
{"date"=>"Mon, 31 Oct 2022 17:15:15 GMT", "content-type"=>"application/json", "content-length"=>"135", "x-amzn-requestid"=>"...", "x-amzn-errortype"=>"ExpiredTokenException", "x-amz-apigw-id"=>"....."} Response body: { "errors": [ { "message": "The security token included in the request is expired", "code": "Unauthorized" } ] } :

I am roughly using the same code from the readme to configure the gem and have placed this in an initializer.  i am using the iam role strategy to authenticate. Is there an issue with having it in an initializer vs calling it more regularly? I'm running this within a rails app and when I reboot the app, things seem to correct themselves so wondering if this code is meant to execute more regularly than in an initializer.  Perhaps the "SecureRandom.uuid" is something that needs to be refreshed along with the token?
require 'aws-sdk-core'
require 'amz_sp_api'
require 'fulfillment-outbound-api-model'

  AmzSpApi.configure do |config|
    config.refresh_token =
    config.client_id =
    config.client_secret =

     config.credentials_provider = Aws::STS::Client.new(
         region: AmzSpApi::SpConfiguration::AWS_REGION_MAP['eu'],
         access_key_id: ,
         secret_access_key:
    ).assume_role(role_arn: my_role_arn , role_session_name: SecureRandom.uuid)

    config.region = 'eu'
    config.timeout = 20 # seconds
    # config.debugging = true

    # optional lambdas for caching LWA access token instead of requesting it each time, e.g.:
    config.save_access_token = -> (access_token_key, token) do
      Rails.cache.write("SPAPI-TOKEN-#{access_token_key}", token[:access_token], expires_in: token[:expires_in] - 60)
    end
    config.get_access_token = -> (access_token_key) { Rails.cache.read("SPAPI-TOKEN-#{access_token_key}") }
  end

The above code is in an initializer. Separately I call the api executing functions like in the example
  begin
    api = AmzSpApi::FulfillmentOutboundApiModel::FbaOutboundApi.new(AmzSpApi::SpApiClient.new)
    p api.list_all_fulfillment_orders.payload
  rescue AmzSpApi::ApiError => e
    puts "Exception when calling SP-API: #{e}"
  end

@ishields did you figure this out? I just run through the exactly same problem and same error as you.


⚠ Bofrost.fr has degraded performance

In 4677c91, Bofrost.fr (https://www.bofrost.fr) experienced degraded performance:

HTTP code: 200
Response time: 964 ms

Resolved: Bofrost.fr performance has improved in 9840d7d.


[Button] works for MonoBehaviours, not NetworkBehaviours

If I try to use ButtonAttribute on a Network Behaviour, the editor doesn't show any changes. It's likely due to how it is implemented.

Ah, the README suggests this is intentional.


Best Practices for Container Deployments

I have ran into an issue where monitoring 350 routers on 1 container results in sometimes getting null values returned for link names. Increasing the timeout value has helped but the issue persist. Specifically concerning is when the Link State has a value of 'initial' and the Link Name has a value of Null.
Is there any best practices based on any known limitations with the container?

Should we separate out device types to reduce load on the container?  For example isolating each container to monitor only routers, access points, and switches for example?
What is the appropriate way to declare cidr ip ranges? Because the discovery takes so long to complete the cidr range, the container gets hung up and doesn't discover devices later in the range. What is the best way to manage cidr declaration in the container configuration to not have to specifically use a long list of /32 addresses.
Is monitoring about 1000 access points per each container going to be a problem?

If you could help with answering these questions that would be extremely helpful. This is the link to the kentik profile if you need it:

https://github.com/kentik/snmp-profiles/tree/main/profiles/kentik_snmp/velocloud

All great q's. As usual, the answer is "it depends".

Should we separate out device types to reduce load on the container?  For example isolating each container to monitor only routers, access points, and switches for example?

Its not so much the type of device as number of devices which can cause load. Ideally you will keep around say 100 devices per container instance.

What is the appropriate way to declare cidr ip ranges? Because the discovery takes so long to complete the cidr range, the container gets hung up and doesn't discover devices later in the range. What is the best way to manage cidr declaration in the container configuration to not have to specifically use a long list of /32 addresses.

How big of a space are you talking about? And how dynamic is the environment? Is it feasible to list some /24s and call it a day?

Is monitoring about 1000 access points per each container going to be a problem?

Ideally you'll have 10 instances monitoring these 1000 aps. Reducing latency is also the key to scaling. Can you locate the ktranslate containers close-ish to the buildings where the APs are?

Gonna close this but feel free to re-open if you still need feedback.

Thank you, we are trying to monitor about 6400 devices and they are static ip'ed so after the discovery we could remove the ranges if that would help.  Is it a requirement that the container be on the LAN with devices?   We are trying to monitor them over sd-wan connections with avg 30msec latency, how big of an issue could that be?  Is there a way to know if that is causing the NULL value issues?

Wanted to reopen:
Thank you, we are trying to monitor about 6400 devices and they are static ip'ed so after the discovery we could remove the ranges if that would help. Is it a requirement that the container be on the LAN with devices? We are trying to monitor them over sd-wan connections with avg 30msec latency, how big of an issue could that be? Is there a way to know if that is causing the NULL value issues?

Looks like the outstanding question was answered in https://github.com/kentik/ktranslate/issues/729


Update documentation to reflect latest threat story changes

Things that have changed and need to be updated in docs:

Projects
Labels
Threat yaml

Will do this as part of rewriting all the existing YAML files


Observing span metrics/analytics for Jaeger UI using Jaeger and/or Prometheus

Hello!
A question, is it necessary to use Prometheus to monitor Jaeger metrics (spans sent, trace data, etc.) or is there a way to just use Jaeger itself, (I'm sure there is, just not sure how)? The application for this is a research project I am working on that uses Jaeger UI to view node/server interactions for sensor nodes that collects physical data and reports it to a server for review/collection all linked via IOT. (especially for finding a link of possibly dropped spans due to packet loss, timeouts, physical interruptions)
Thank you!

You can access the /metrics endpoint for the raw data, but if you want to collect a time series for plotting / analysis you will need to use a metrics system like Prometheus or similar that can scrape the data.


Feature Request: Support controled rollout of changes

Is your feature request related to a problem? Please describe.
The current customization pipeline solution does not offer a way to deploy using SDLC methodologies, e.g. deploying to a subset of the environment where testing and validation can occur prior to rolling out to the environment as a whole.
Describe the feature you'd like
I want the ability to test changes to our environment before they're rolled out to the whole environment.  This should include the ability to deploy to a subset of accounts, where our team(s) can perform testing and validation.  I want to the ability to introduce a change to groups of accounts in a defined progression, much like how software development teams introduce a change through development, test, qa, etc before finally reaching production.
Additional context
There have been similar requests that would begin to enable such a behavior, but those have been closed as essentially "not currently supported".  I don't think that is acceptable and I think inclusion in a product roadmap, and indication of where on that roadmap this feature request is should be offered.

#40
#63

@cacack Thanks for the request. We have added this to our backlog.

Hey @cacack, upon looking deeper into this, I believe controlled rollout is something that is possible today using the GitOps model, by rolling out infrastructure to development accounts in a single commit, and then expanding to staging accounts in a secondary commit, and then production in a final commit.
Let me know if I misunderstood your request here!


Depend on numpy 1.21.

Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Please tag this pr with at least one of these labels to make our release process faster: BREAKING, new feature, bug fix, other change, dev setup

Let's wait a bit.


Implementation of a class to choose and build storage clients for each task

Creates an interface and implementation StorageSelector which:

Takes in:

a certificate manager, which we expect to have access to the API's certificate service, our local privateKey, and a method to grab the local root certs to validate the exchange-specific certs we read.
stored connection information for each recurring exchange the client is party to
the local private key

Based on that, builds an appropriate storage client, properly authorized,  for use in the task execution

Also adds an interface for the certificate manager.
Includes test classes for both.

This change is

This has been broken up for size


Improve error message for missing source/target test file

The current error message for missing files does not include the actual file path.
As such one currently has to guess it from the last logged test case.

Thanks for this PR, it looks good! Could you rebase please?

Done.


fix nccl block, fix dual merge sparse bug, thrust used memory pool and remote default stream used,  remove sample used default stream

lgtm


node_cache: Disable pnpm update check

Cool, I remember we used the --prefer-offline option in yarn too, though they probably do different things.

This seems like what we want.
If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server. To force full offline mode, use --offline.


Tables cannot be constructed.

Table frame acts like a normal table, doesn't let you do the next step because you just place the item on it.

Related #4857


List scans within a study

Hi,
Not sure if you are interested in this but I wanted a way to easily see some basic details about scans within a study. I needed this to help work out which scans within the study I actually wanted to convert and analyze. The first two commits in this pull request are a bare bones implementation. It just displays the subject name, scan date/time and the protocol/method/scan duration for each scan. The code to derive this information is generic for all UIs but only the CLI UI is modified to display this information. The command to do this is:
bruker2nifti list -i ...
The CLI UI is modified in such a way that the first argument ('list' in this case) is the command to run. 'convert' would convert the scan. If no command is specified it defaults to convert and so remains backwards compatible.
The third commit in this pull request is a little separate but just a small fix to listing scans for conversion. The current implementation only supports single digit scan ids. The option --scans can now be supplied which supports multi-digit scan ids. For backwards compatibility -scan_list is retained unmodified.
Cheers,
Jath

Updated the import directives.
Please see comment above about the list_scans function.

Updated the import directives.
Please see comment above about the list_scans function.

All good thanks for tour help!

Made few changes afterwards due to incompatibility between fixtures and python2.7 and list reordering across python versions. Keep this branch in mind for when python 2.7 will not be supported anymore.


redis-cli --eval and ARGV

Hi,
I'm learning Redis Lua scripting with redis-3.0.501 on Win 7/Win 8.1. I want to get values from ARGV.
With Redis REPL, I get :
<IP_ADDRESS>:6379> EVAL "return {KEYS[1], ARGV[1]}" 1 a b
1) "a"
2) "b"

If I put "return {KEYS[1], ARGV[1]}" into a file, say test.lua
PS> Set-Content -Path test.lua -Value "return {KEYS[1], ARGV[1]}"
PS>  redis-cli -a sb --eval test.lua a , b
1) "a"

ARGV is nil.
But I can do  the form:
PS> redis-cli.exe -a sb EVAL "$(Get-Content test.lua)" 1 a  b
1) "a"
2) "b"

Is it a real issue, or is my syntax wrong?
Thanks in advance,
jg

Hi @jgranduel
using the Windows command prompt (not the Windows powershell) the command that didn't work for you, worked for me:
C:\tmp>redis-cli -a sb --eval test.lua a , b
1) "a"
2) "b"

Is it possible that the comma causes the problem when the command is executed in powershell?

You are absolutely right! the same here. I should have tested!
So I had the idea of escaping the comma :
PS > redis-cli -a sb --eval test.lua a `, b
1) "a"
2) "b"

Strange syntax, but usable.
Thanks

You are absolutely right! the same here. I should have tested!
So I had the idea of escaping the comma :
PS > redis-cli -a sb --eval test.lua a `, b
1) "a"
2) "b"

Strange syntax, but usable.
Thanks


Implement Functionality of Reset Password Screen

I will do this but I see it doesn't have a design should I go ahead?


Fix: Add coverage for AdminAccessTrait

This PR

[x] cherry-picks 749c0df so we can autoload test resources
[x] asserts that the AdminAccessTrait works as it claims it does
[x] asserts that __call() never intercepts a method call to an existing method
[x] removes useless __call()
[x] asserts that method argument is never used
[x] removes unused method argument
[x] removes unused method argument from method calls

Follows #249.
Related to #247.

Thanks @localheinz


Memory leaks

Great library so far, but I noticed you use raw pointers a lot in various classes. almost all cone() functions create new pointers (which is okay if managed properly), but then almost every setter function calls clone() without freeing the previous pointer. so if we set_XXX() multiple times we will end up with many loose pointers AKA a memory leak.
try putting this in your main loop and watch the memory go:
for (int i = 0; i < 1000; i++)
{
    scene.set_controller(controller);
}

Yes, we would never want to set the controller every frame, but if I wanted to switch between two controllers it would leak memory every time.
I'd suggest using shared pointers, deleting the old pointer before setting the new one, or not clone at all and instead use the passed in parameter.

Thanks, I fixed it: 1e259f0e2d6ea14f5fd6568d7596e7aaf087b8e3


[REG2.068a] Issue 14594 - DDoc for template functions and structs has disappeared

https://issues.dlang.org/show_bug.cgi?id=14594

thanks


GH-23: VS Code configuration for test debugging

To do:

Prepare version fixes
Update changelog & template version (maybe)
Update README with technologies


Android Phone crashes after 30/40 mins of plugin usage

Your Environment

Plugin version: 2.2.5 (latest as per today)
Platform: Android
OS version: 6
Device manufacturer and model: Samsung A3
Cordova version (cordova -v):
Cordova platform version (cordova platform ls):
Plugin configuration options:
Link to your project:

Context
Started the background activity while driving, with Waze active and some phone calls...
Expected Behavior
Should not crash app an phone
Actual Behavior
At random, after 30/40 minutes the phone crashes
Possible Fix

Steps to Reproduce
This is my configuration file.
I save all readings in a GPX file and I don't need to use the internal position save feature.
No info is sent to server.
I suspect my configuration is too aggressive:
//         debug: true,
desiredAccuracy: 10, //< than ...
stationaryRadius: 50,
distanceFilter: 50,
startForeground: true, //android
interval: 1000, //android
notificationTitle: aanotificationTitle, //android
notificationText: aanotificationText, //android
notificationIconColor: "#b4c1d7", //android
notificationIconLarge: "icon", //android
notificationIconSmall: "mappointer_small", //android
locationProvider: backgroundGeolocation.provider.ANDROID_ACTIVITY_PROVIDER, //android
activityType: "OtherNavigation", //iOS
pauseLocationUpdates: false,  //iOS
saveBatteryOnBackground: false, //iOS
fastestInterval: 5,
activitiesInterval: 10,
stopOnStillActivity: false, //android
maxLocations: 100
Is my configuration too aggressive?
What would be ideal parameters for an activity similar to continuos walking/running for 2/4 hours?
Thanks a lot
Luigi

Please provide some logs. Either from plugin or from adb logcat. Try to locate moment of crash.

Notice: this issue has been closed because it has been reported for branch 2.x or later. It could be already fixed in v3 or is not relevant anymore. You may reopen this issue if it has been closed in error.


Add extra test cases for maven version qualifiers and separators

What are you trying to accomplish?
Improve the level of testing in our maven version implementation by adding extra test cases for version qualifiers and separators. This will help ensure that our implementation is robust and can handle a variety of version strings.

Fix issues related to version precedence
Checklist

[x] I have run the complete test suite to ensure all tests and linters pass.
[x] I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
[x] I have written clear and descriptive commit messages.
[x] I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
[x] I have ensured that the code is well-documented and easy to understand.

I think, I'll have to reimplement this in order to resolve issues with sorting.

Closed in favor of https://github.com/dependabot/dependabot-core/pull/10524


Ensure consistent URLs if the content is the same

Currently, all URLs use a random UUID, so that a URL for a host changes
when the controller is restarted. It only works well, because the BMH
controller does not track URL changes.
To enable the BMH controller to make decisions based on URLs, this
change switches to stable URLs formed as:
/<sha256 of the base image>/<sha256 of ignition>

This way, the URL only changes if the base image is updated (e.g. on OCP
upgrade) or new Ignition is used.

I'm interested in why you chose this vs. adding a field to the Status containing the hash?
One of the reasons for the random URLs was security - since the controller endpoint is available to everyone, we don't want to announce what hosts exist in what namespaces. There's nothing exploitable here, but it does start to mix stuff (user-provided data, hashes, aliasing of URLs) that has been known to cause problems in other circumstances in the past. (I guess there's a very, very minor data leak, in that you can determine if a host exists somewhere in the cluster with a given config.)
So I would marginally prefer a separate field. I also think that gives controllers more flexibility to treat URL choice separately from forcing reboots.

I'm interested in why you chose this vs. adding a field to the Status containing the hash?

At the very least, extending Status requires changes to upstream baremetal-operator, which will raise a question "why cannot you just change the URL?" Changing the URL will also play nicely with the Ironic's caching mechanism (which I suspect we currently bypass by not providing Last Modified, but should eventually support).

I guess there's a very, very minor data leak, in that you can determine if a host exists somewhere in the cluster with a given config

We could probably forbid listing all images by making / return 403. I don't think anyone uses this functionality anyway.

I'm interested in why you chose this vs. adding a field to the Status containing the hash?

I guess the correct (from HTTP best practices standpoint) way is to use a stable URL + "Last Modified" header for change detection + some sort of authentication. It's problematic with the way ICC is implemented though.

We could probably forbid listing all images by making / return 403. I don't think anyone uses this functionality anyway.

I'm pretty sure we already don't allow that, but with this change you could create a PreProvisioningImage CR with a particular config, get the URL, and then delete the CR. If the URL still works after the CR is gone then somebody else is using the same config. I doubt you could do that fast enough to exfiltrate any meaningful data, but I was happier when I didn't have to think about it.

At the very least, extending Status requires changes to upstream baremetal-operator,

This is true and definitely a downside...

which will raise a question "why cannot you just change the URL?"

...but not for this reason. I can't think of anyone who would raise this question, and if they did the answer is "because it puts (new) constraints on the third-party-pluggable controller implementation, and adding an optional checksum field does not".

Changing the URL will also play nicely with the Ironic's caching mechanism (which I suspect we currently bypass by not providing Last Modified, but should eventually support).

I guess the correct (from HTTP best practices standpoint) way is to use a stable URL + "Last Modified" header for change detection + some sort of authentication. It's problematic with the way ICC is implemented though.

A 'Last modified' header wouldn't actually be too hard, because we store the last transition time in the conditions in the CR Status, so we could use that timestamp when recreating an image after a restart. We'd have to make sure we did a condition transition iff the image content had changed.
We could even do a stable random URL by just reading back the URL in the Status and using it again after the restart. In fact, we could base the URL on only the UID of the PreprovisioningImage CR, so that it stays constant for the life of the CR.
I'm not sure how that helps though. The BMO could do a HEAD request to get the last modified time. But it doesn't currently have anywhere to store the timestamp of the previous boot to compare it to. And this is placing even more onerous requirements on the PreprovisioningImage controller than stable URLs would.
One other thought: could we make a mechanism where BMO will restart the host only if the PreprovisioningImage is deleted entirely? (This could be done by remembering the UID of the PreprovisioningImage we used to boot.) That would put control in the hands of the user - they could make whatever changes they want to the config that will get picked up on the next reboot, but only deleting the image CR would trigger a reboot. In the ZTP case, every time the InfraEnv changes, all image labelled with that InfraEnv ID would be deleted and the BMO would recreate them. I think the main problem, again, is having somewhere to store that ID from the last boot. In ironic doesn't count because Ironic itself may get restarted. We shouldn't always trigger a reboot in that case because now the proxy makes it unnecessary IIRC?

/hold
The idea looks doable, I'll check with Nick. I don't think it's a big deal upstream to suggest tracking the UID of the last used preprovisioningimage.

Thinking more about my suggestion more with the benefit of sleep... we don't create the PreprovisioningImage CR in the available state. We could possibly use the disappearance of the CR as the trigger to return to the preparing state (which would recreate the CR) and not even need to store the UID. But we'd be taking away the user's ability to e.g. delete the CR after it is no longer needed just to free up storage or whatever, and giving that action another meaning. We probably shouldn't invent new semantics for the k8s API like this.

We could possibly use the disappearance of the CR as the trigger to return to the preparing state (which would recreate the CR) and not even need to store the UID.

Would work for the "normal" metal3 case, but the assisted installer integration in question is most likely to leave the nodes for a long time in the "deploy wait" state.

But we'd be taking away the user's ability to e.g. delete the CR after it is no longer needed just to free up storage or whatever, and giving that action another meaning.

What I like even less is the dependency on the current state. The current proposal interrupts all states that can be interrupted ("* wait" and "available").

/close
... in favor of https://github.com/metal3-io/baremetal-operator/pull/1237


Lesson 4: "No module named solcx".

Hi there, I realize a similar question was raised by another user but they seem to have found a solution which doesn't work for me. The other solution was posted here: https://github.com/smartcontractkit/full-blockchain-solidity-course-py/issues/1473.
I am using Windows, Python version 3.10.5. I use "pip install py-solc-x" on my terminal and it seems to install properly ("requirements already satisfied"), but when I run "from solcx import compile_standard" on a python file, it gives me the "No module named solcx" error. I can import other modules such as numpy fine. I also checked, and I am pretty sure I have the Solidity extension installed on Visual Studio Code.
Heres the text which appears over the code, it says "Import "solcx" could not be resolved Pylance(reportMissingImports)"

I can only guess what this exactly means.
Running the "help(modules)" command, I cant see solcx on the list of modules it gives, so maybe I'm installing it to the wrong place somehow? This seems to me like a very specific issue that is going to be different for every user
So I suppose my strategy to solving this is:
Where should solcx be?
Is the "from" command looking in the right place?
How do I change where the "from" command is looking for modules?
Am I installing solcx to the wrong place? If so, how do I change the installation path.
Maybe the solcx command should be preceded by something akin to a file path, indicating where Python should look for it?
Any pointers would be appreciated :)

I am having the same exact issue.
I ran "pip install py-solc-x" again and it says everything already installed.
I have had this sort of trouble with VS code in the past. Might be some sort of PATH issue

Oh wait. I got it to work. Copy past this exact code and see if it works:
from solcx import compile_standard, install_solc
with open("./SimpleStorage.sol", "r") as file:
simple_storage_file = file.read()
print("Installing...")
install_solc("0.6.0")
compiled_sol = compile_standard(
{
"language": "Solidity",
"sources": {"SimpleStorage.sol": {"content": simple_storage_file}},
"settings": {
"outputSelection": {
"": {"": ["abi", "metadata", "evm.bytecode", "evm.sourceMap"]}
}
},
},
solc_version="0.6.0",
)
print(compiled_sol)

hey, pls check if this will help you.
https://stackoverflow.com/questions/70326346/vscode-doesnt-recognize-py-solc-x-doesnt-library


(testnet) confirmed transaction shows as pending

https://test-insight.bitpay.com/address/2MsxBxpFuHc81yhzipp4zXZgobWeVnXt15w
is confirmed for a few days, but still shows as pending:
stack exec hw -- -w .hw -t --keyring main txs test_1_of_2
Page 1 of 1
Value      : Incoming 2000000
Confidence : Pending
Inputs     : mnEauNZdTYfK6ZrjuSzB95yDPuAk8iBZWo
             mnEauNZdTYfK6ZrjuSzB95yDPuAk8iBZWo
Outputs    : n1KfQ2VtCoMg9BJuSDRGhkUSjqTYLref4d 10450143
             2MsxBxpFuHc81yhzipp4zXZgobWeVnXt15w 2000000 <-

This is a known problem where bloom filters weren't being sent. It is fixed by #222


How to push and popup the SWRevealViewController from UIViewController

Hi John,
I am using SWRevealViewController in my project.This Reveal Controller is easy to worked in my project.Now my client want to change the RevealController to next page.I need  this format,when i open the application first i want to display front page,in that front page,tap the button it is push to SWReveal Controller,it works fine.From that reveal page,i want to pop up to front page,it doesn't work for me.Here i attached my screen shot.
Thanks
Sudalai

i cant back to viewcontroller on swrevealviewcontroller please help me!!!!

Your question does not mean anything ! Can you be more specific if you want an answer?

Hi John, How can I use the menu without going to the other controller instead calling a function in the current view

Retrieve your front view controller:
let yourController = reveaController().frontViewController as? YourController
yourController.myFunction()

Thanks.. but how i can implement it on objective-c

The same!
YourController *yourController = (YourController *)self.revealViewController.frontViewController;
[yourController myMethod];
if yourController is embedded in a navigation controller:
UINavigationController *nc = (UINavigationController *)self.revealViewController.frontViewController;
YourController *yourController =  (YourController *)nc.topViewController;
[yourController myMethod];

Thanks Sir.. It Works,
I've added [self.revealViewController revealToggle:nil]; at the top of the code to reveal the previous controller that should perform the function..
Thanks :)
This is my first time to ask question and it really helps..

let destination = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "SubCategoryVC")
self.revealViewController().pushFrontViewController(destination, animated: true)
this code is not working properly ...plz guid me how to back previous controller

this code is not working properly

What is the issue?

sir i have attache my demo program. can you check my code sir ?
On 5 Dec 2017 7:50 pm, "Patrick"<EMAIL_ADDRESS>wrote:

this code is not working properly
What is the issue?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/John-Lluch/SWRevealViewController/issues/244#issuecomment-349317772,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AU0jo-7XeVcaTnVSXGTB-Jd_LVgn3Zmyks5s9VFEgaJpZM4B4NBW
.

let destination = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "SubCategoryVC")
self.revealViewController().pushFrontViewController(destination, animated: true)

So destination is nil, check the identifier in the storyboard.

yes, sir i have give the same name  subCategoryVC

If you put a breakpoint on this line, what is nil? destination or self.revealViewController()?

And I can't see you demo project anywhere!

is there any method to pop the front view controller?? like there is a method "pushFrontViewController" : self.revealViewController().pushFrontViewController(vc, animated: true)
I want the pop method for this. My scenarios is I have MenuVC as RearVC. and FrontVC is a NavigationVC.

Set the Navigation controller in Root controller and access in all screen
On Mon, 9 Jul 2018, 7:15 pm SaadNT<EMAIL_ADDRESS>wrote:

is there any method to pop the front view controller?? like there is a
method "pushFrontViewController" :
self.revealViewController().pushFrontViewController(vc, animated: true)
I want the pop method for this. My scenarios is I have MenuVC as RearVC.
and FrontVC is a NavigationVC.
[image: git]
https://user-images.githubusercontent.com/37143643/42454120-19e36258-83a8-11e8-90f2-4ed2cb856e67.png
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/John-Lluch/SWRevealViewController/issues/244#issuecomment-403484109,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AU0jowq9i8Vsq4y-5k63pbw1UEMfTuyxks5uE15bgaJpZM4B4NBW
.

@786BhaveshChavda it will cause another issue :(

@786BhaveshChavda

            // Push with front's navigation controller to have a back button to it.
            UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:_frontViewController];
            [self.revealViewController setFrontViewController:nc animated:NO];
            [nc pushViewController:_otherViewController animated:NO];
            [self.revealViewController setFrontViewPosition:FrontViewPositionLeft animated:YES];

It is exactly what the code does.

I have just retrieved a sample I wrote in Swift for this purpose:
SWHomePushSwift.zip

@iDevelopper let me check that.. BTW, ty

is it the above project  SWHomePushSwift.zip an extension of SWRevealViewController?? I am talking about the implementation. What if I replaced my current files of SWRevealViewController with the above files??

@iDevelopper thanks a lot man.. 👍

No, it is not an extension at all.

actually the base for this is to push any VC from menu VC using the navigation controller of the front VC of SWRevealViewController, which will eventually Push from front VC.  @iDevelopper


Remove rust::Slice repr conversion in C++

These layout conversions between pod and non-pod were made obsolete by #387, as since then rust::Str and rust::Slice<T> are correctly implemented as pod.

I think this'll work but one additional workaround is required by MSVC. https://stackoverflow.com/a/57429504/6086311

I think this'll work but one additional workaround is required by MSVC. https://stackoverflow.com/a/57429504/6086311

Rebased on #637.

Rebased on #637.


support nunjucks context configs through nunjucksrc file

hi @devmattrick  😀
First of all, thank you for creating this library
But when I am using it, I find that we need to configure some details, so I fork your library, and add the function of reading RC files, hope to be able to merge, convenient for everyone to use, if there is any problem, you can leave a message to me, thank you.

This looks great!