Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Here is an [overview](facto/inputgen/overview.md) of InputGen

SpecDB is a [database](facto/specdb/db.py#L30) of specifications covering most of the Core ATen Ops. They have been developed using the ATen CPU kernels as a reference.

## Instalation
## Installation
```bash
git clone https://github.com/meta-pytorch/FACTO.git
cd FACTO
Expand Down
4 changes: 2 additions & 2 deletions facto/inputgen/argtuple/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@


def reverse_topological_sort(graph):
def dfs(node, visited, strack):
def dfs(node, visited, stack):
visited[node] = True
for neig in graph[node]:
if not visited[neig]:
dfs(neig, visited, strack)
dfs(neig, visited, stack)
stack.append(node)

visited = {node: False for node in graph}
Expand Down
4 changes: 4 additions & 0 deletions facto/inputgen/argument/type.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ class ArgType(str, Enum):
StringOpt = "String?"
MemoryFormat = "MemoryFormat"

def __str__(self):
cls_name = self.__class__.__name__
return f'{cls_name}.{self.name}'

def is_tensor(self) -> bool:
return self in [ArgType.Tensor, ArgType.TensorOpt]

Expand Down
2 changes: 1 addition & 1 deletion facto/inputgen/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ An argument of an op might depend on another argument. For example, an argument
### Constraints

A given constraint has 3 parts: an attribute, a suffix and a lambda function.
We already went through the attributes. The suffix is a basic operation, like Equal (Eq), Not Equal (Ne), Less than (Lt), Greather than (Gt), etc.
We already went through the attributes. The suffix is a basic operation, like Equal (Eq), Not Equal (Ne), Less than (Lt), Greater than (Gt), etc.
The lambda function takes the dependencies (other arguments) as inputs, and outputs certain value. The constraint should then be read as: attribute suffix value. For example, if the attribute is Length, and suffix is Gt, and the lambda function outputs 4, then the constraint is saying that the Length > 4.

## Generation
Expand Down
10 changes: 5 additions & 5 deletions facto/inputgen/variable/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class Discrete:
"""
Representes a set of discrete values. Examples:
Represents a set of discrete values. Examples:

>>> d = Discrete(['a','b','c'])
>>> d.contains('a')
Expand Down Expand Up @@ -149,9 +149,9 @@ def __init__(
self.upper_open = upper_open

def __str__(self) -> str:
lower_braket = "(" if self.lower_open else "["
upper_braket = ")" if self.upper_open else "]"
return f"{lower_braket}{self.lower}, {self.upper}{upper_braket}"
lower_bracket = "(" if self.lower_open else "["
upper_bracket = ")" if self.upper_open else "]"
return f"{lower_bracket}{self.lower}, {self.upper}{upper_bracket}"

def __eq__(self, other: "Interval") -> bool:
return (
Expand Down Expand Up @@ -337,7 +337,7 @@ def set_lower(self, lower: Union[int, float], lower_open: bool = False) -> None:

def set_upper(self, upper: Union[int, float], upper_open: bool = False) -> None:
"""Sets the upper bound, being open or closed depending on the flag. In other
words, it removes all values greather than the given value. It also removes the value
words, it removes all values greater than the given value. It also removes the value
itself if upper_open is True."""
for ix, r in enumerate(self.intervals):
if r.upper < upper:
Expand Down