def test_scopes_for_function_inputs():
        """
        If a var's parent op is a placeholder, we cannot set its scopes.
        And its scopes is an empty dictionary.
        """

        @mb.program(input_specs=[mb.TensorSpec(shape=(2, 3))])
        def prog(x):
            assert len(x.scopes) == 0
            with mb.scope(
                ScopeInfo(source=ScopeSource.TORCHSCRIPT_MODULE_NAME, data=["module_1"]),
            ):
                y = mb.add(x=x, y=5.4)

            with pytest.raises(
                ValueError,
                match="Cannot set scopes to a function input var",
            ):
                x.scopes = y.scopes

            return y

        If a var's parent op is a placeholder, we cannot set its scopes.
        And its scopes is an empty dictionary.
        
coremltools/converters/mil/mil/tests/test_programs.py