Skip to content

Commit

Permalink
Fixed patgen InitPats to create scalar Name column -- was a 1d tensor…
Browse files Browse the repository at this point in the history
…, prevented SetCellString from working
  • Loading branch information
Randall C. O'Reilly committed May 14, 2021
1 parent 6859474 commit b4eaa81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions patgen/configpats.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func InitPats(dt *etable.Table, name, desc, inputName, outputName string, listSi
dt.SetMetaData("name", name)
dt.SetMetaData("desc", desc)
dt.SetFromSchema(etable.Schema{
{"Name", etensor.STRING, []int{1}, []string{"Name"}},
{"Name", etensor.STRING, nil, nil},
{inputName, etensor.FLOAT32, []int{ySize, xSize, poolY, poolX}, []string{"ySize", "xSize", "poolY", "poolX"}},
{outputName, etensor.FLOAT32, []int{ySize, xSize, poolY, poolX}, []string{"ySize", "xSize", "poolY", "poolX"}},
}, listSize)
Expand All @@ -32,7 +32,7 @@ func MixPats(dt *etable.Table, mp Vocab, colName string, poolSource []string) er
ySize := dt.ColByName(colName).Shapes()[1]
xSize := dt.ColByName(colName).Shapes()[2]
for row := 0; row < listSize; row++ {
dt.CellTensor("Name", row).SetString([]int{0}, fmt.Sprint(name, row))
dt.SetCellString("Name", row, fmt.Sprint(name, row))
npool := 0
for iY := 0; iY < ySize; iY++ {
for iX := 0; iX < xSize; iX++ {
Expand Down Expand Up @@ -71,7 +71,7 @@ func MixPatsN(dt *etable.Table, mp Vocab, colName string, poolSource []string, t
for ri := 0; ri < vocabN; ri++ {
row := targRow + ri
vocIdx := vocabStart + ri
dt.CellTensor("Name", row).SetString([]int{0}, fmt.Sprint(name, row))
dt.SetCellString("Name", row, fmt.Sprint(name, row))
npool := 0
for iY := 0; iY < ySize; iY++ {
for iX := 0; iX < xSize; iX++ {
Expand Down

0 comments on commit b4eaa81

Please sign in to comment.