SShapeEstuary
AI coding workspace

Tensor broadcast shapes

ShapeEstuary is a Windows AI coding client for exploring tensor-shape logic in source files. Ask a compatible model to explain trailing-axis comparisons, then review its changes against scalar and zero-axis cases.

● ● ●ShapeEstuary●
A concrete starting point · Tensor broadcast shapes ×
from itertools import zip_longest

def broadcast_shape(a, b):
    a, b = tuple(a), tuple(b)
    if any(type(d) is not int or d < 0 for d in a + b):
        raise ValueError("dimension.invalid")
    result = []
    for left, right in zip_longest(reversed(a), reversed(b), fillvalue=1):
        if left == right or right == 1:
            result.append(left)
        elif left == 1:
            result.append(right)
        else:
            raise ValueError("shape.incompatible")
    return tuple(reversed(result))
✳Infer a shared tensor shape by comparing trailing dimensions and expanding unit axes.
✓ ChangesReview before applying ↗
Illustrative workspace
  1. Project

    Check scalar shapes and zero-sized axes with unit dimensions, rejecting incompatible, negative or fractional dimensions.

  2. Review before applying

    Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.

  3. Connection

    Base URL, credentials and a reachable server.

Workflows

Tensor broadcast shapes

Workflows ↗
A concrete starting point
from itertools import zip_longest

def broadcast_shape(a, b):
    a, b = tuple(a), tuple(b)
    if any(type(d) is not int or d < 0 for d in a + b):
        raise ValueError("dimension.invalid")
    result = []
    for left, right in zip_longest(reversed(a), reversed(b), fillvalue=1):
        if left == right or right == 1:
            result.append(left)
        elif left == 1:
            result.append(right)
        else:
            raise ValueError("shape.incompatible")
    return tuple(reversed(result))
AI coding workspace

Follow shape assumptions through a numerical project

ShapeEstuary gives numerical software work a Windows workspace where a project folder and an AI conversation stay connected. Start with the operation that fails or returns an unexpected shape. Ask your chosen model to inspect the surrounding transformations and explain their assumptions before requesting a patch. That approach keeps the investigation attached to the pipeline that actually uses the result.

For example, broadcast.py can anchor a review of shape compatibility. A useful request names the incoming dimensions, the expected output shape and the behavior required for incompatible inputs. Ask how the helper's result is used downstream, rather than treating the example as a complete numerical system. The software supplies the coding workspace; your project determines which array library, data and runtime checks the task needs.

Unrestricted AI models are available to choose when a supported OpenAI-compatible or Anthropic endpoint exposes them. Set up the service address and required credentials, then check its capabilities for your task. Review proposed edits and test representative shapes, including empty dimensions where your contract allows them. Compare the resulting behavior with the numerical library used by your application. This gives the conversation evidence about compatibility without confusing a model's confident explanation with verified numerical behavior.

Review questions for numerical shape work

What should accompany a shape-mismatch report?

Provide the input shapes, failing operation, expected result and relevant library version. A small reproducible case helps connect the symptom to the source. Avoid sending a large dataset when dimensions and representative values can explain the problem.

Does this workspace provide GPU acceleration?

No acceleration capability is established by the coding workflow. Your project's libraries, hardware and runtime determine execution. Use ShapeEstuary to inspect and discuss code changes, then measure and verify them in the environment where the numerical work runs.

How should zero-sized dimensions be handled?

State whether the application accepts them and compare the proposed behavior with its array library. Test valid and incompatible combinations. Do not let a generic rule about positive dimensions silently replace an existing contract that permits empty results.

Should I change downstream code when the helper changes?

Inspect its consumers first. A different output shape or error type may require coordinated updates. Ask for the affected assumptions to be identified, then review those edits together and run tests covering the full operation.

Get the Windows app ↗

ShapeEstuary · Updated 2026-10-25