# Path: src/e2eflow/ops.py
# OP_NAMES = ['backward_warp', 'downsample', 'correlation', 'forward_warp']
# def compile(op=None):
# def correlation(first, second, **kwargs):
# def _BackwardWarpGrad(op, grad):
# def _ForwardWarpGrad(op, grad):
# def _CorrelationGrad(op, in_grad, in_grad1, in_grad2):


import tensorflow as tf
from ..ops import downsample as downsample_ops


def summarized_placeholder(name, prefix=None, key=tf.GraphKeys.SUMMARIES):
    prefix = '' if not prefix else prefix + '/'
    p = tf.placeholder(tf.float32, name=name)
    tf.summary.scalar(prefix + name, p, collections=[key])
    return p


def resize_area(tensor, like):

# Path: src/e2eflow/ops.py
# OP_NAMES = ['backward_warp', 'downsample', 'correlation', 'forward_warp']
# def compile(op=None):
# def correlation(first, second, **kwargs):
# def _BackwardWarpGrad(op, grad):
# def _ForwardWarpGrad(op, grad):
# def _CorrelationGrad(op, in_grad, in_grad1, in_grad2):


# Path: src/e2eflow/core/util.py
import tensorflow as tf
from ..ops import downsample as downsample_ops



def summarized_placeholder(name, prefix=None, key=tf.GraphKeys.SUMMARIES):
    prefix = '' if not prefix else prefix + '/'
    p = tf.placeholder(tf.float32, name=name)
    tf.summary.scalar(prefix + name, p, collections=[key])
    return p


def resize_area(tensor, like):

    _, h, w, _ = tf.unstack(tf.shape(like))